Commit 76a6abac authored by David E. DeMarle's avatar David E. DeMarle
Browse files

remove openmp-simd flag on older compilers

This will slow down denoising when built on an older machine, but
no worse than it was before oidn v1.2.0.
parent 85012989
......@@ -5,3 +5,6 @@ superbuild_add_project(openimagedenoise
-DCMAKE_INSTALL_NAME_DIR:PATH=<INSTALL_DIR>/lib
-DCMAKE_INSTALL_LIBDIR:STRING=lib
)
superbuild_apply_patch(openimagedenoise fix-openmp-flag
"Fix openmp-simd flag on older compilers")
diff --git a/cmake/oidn_platform.cmake b/cmake/oidn_platform.cmake
index b06853e..a292c2f 100644
--- a/cmake/oidn_platform.cmake
+++ b/cmake/oidn_platform.cmake
@@ -1,6 +1,8 @@
## Copyright 2009-2020 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
+include(CheckCXXCompilerFlag)
+
set(OIDN_C_CXX_FLAGS)
set(OIDN_C_CXX_FLAGS_RELEASE)
set(OIDN_C_CXX_FLAGS_DEBUG)
@@ -142,7 +144,10 @@ if(WIN32)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
append(OIDN_C_CXX_FLAGS "-qopenmp-simd")
else()
- append(OIDN_C_CXX_FLAGS "-fopenmp-simd")
+ check_cxx_compiler_flag(-fopenmp-simd compiler-openmp-simd-support)
+ if(compiler-openmp-simd-support)
+ append(OIDN_C_CXX_FLAGS "-fopenmp-simd")
+ endif()
endif()
## -----------------------------------------------------------------------------
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment