Commit a963e562 authored by David E. DeMarle's avatar David E. DeMarle Committed by Kitware Robot
Browse files

Merge topic 'fixup-oidn-on-bigmac'

76a6abac

 remove openmp-simd flag on older compilers
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Utkarsh Ayachit's avatarUtkarsh Ayachit <utkarsh.ayachit@kitware.com>
Merge-request: !754
parents 86175fd0 76a6abac
......@@ -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