From a83c6293f43a8c8b8603ba9e17c32d34eb9edd4d Mon Sep 17 00:00:00 2001 From: Jens Verwiebe Date: Tue, 8 Jul 2014 23:35:04 +0200 Subject: OSX/CMAKE: Way better fix for T40887, checks where failing with clang-omp - found a way to feed just extra flags to the testcompiles --- CMakeLists.txt | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 38f9854da98..3d0ad4cdde7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2032,16 +2032,8 @@ blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}") if(WITH_OPENMP) find_package(OpenMP) if(OPENMP_FOUND) - # Some tests with clang-omp fail due special buid env ( dylib ) - # we push the openmp flags to buildtype flags to circumvent this as a tentative fix for now - if(APPLE AND CMAKE_C_COMPILER_ID MATCHES "Clang") # Some tests with clang-omp fail due special buid env - string(TOUPPER ${CMAKE_BUILD_TYPE} B_TYPE) - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_${B_TYPE}} ${OpenMP_C_FLAGS}") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_${B_TYPE}} ${OpenMP_CXX_FLAGS}") - else() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") - endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") else() set(WITH_OPENMP OFF) endif() @@ -2166,6 +2158,10 @@ if(CMAKE_COMPILER_IS_GNUCC) elseif(CMAKE_C_COMPILER_ID MATCHES "Clang") + if(APPLE AND WITH_OPENMP) # we need the Intel omp lib linked here to not fail all tests due presence of -fopenmp ! + set(CMAKE_REQUIRED_FLAGS "-L${LIBDIR}/openmp/lib -liomp5") # these are only used for the checks + endif() + # strange, clang complains these are not supported, but then yses them. ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall) ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_DECLARATION_AFTER_STATEMENT -Werror=declaration-after-statement) -- cgit v1.2.3