Commit: a83c6293f43a8c8b8603ba9e17c32d34eb9edd4d
Author: Jens Verwiebe
Date:   Tue Jul 8 23:35:04 2014 +0200
https://developer.blender.org/rBa83c6293f43a8c8b8603ba9e17c32d34eb9edd4d

OSX/CMAKE: Way better fix for T40887, checks where failing with clang-omp
- found a way to feed just extra flags to the testcompiles

===================================================================

M       CMakeLists.txt

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 38f9854..3d0ad4c 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)

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to