fix for cmake flag detection, was not caching the resulting variable so the test...
[blender.git] / CMakeLists.txt
index 89ee0707280be0e02707ae19f660b92d16d4cc15..cc6715f8237f612695e1d80cba5a3a881d515e60 100644 (file)
@@ -962,6 +962,9 @@ if(WITH_OPENMP)
        else()
                set(WITH_OPENMP OFF)
        endif()
+
+       mark_as_advanced(OpenMP_C_FLAGS)
+       mark_as_advanced(OpenMP_CXX_FLAGS)
 endif() 
 
 #-----------------------------------------------------------------------------
@@ -984,32 +987,32 @@ endif()
 
 if(CMAKE_COMPILER_IS_GNUCC)
 
-       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS -Wall)
-       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS -Wcast-align)
-       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS -Wdeclaration-after-statement)
-       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS -Werror=declaration-after-statement)
-       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS -Werror=implicit-function-declaration)
-       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS -Werror=return-type)
-       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS -Werror=strict-prototypes)
-       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS -Wno-char-subscripts)
-       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS -Wno-unknown-pragmas)
-       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS -Wpointer-arith)
-       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS -Wunused-parameter)
-       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS -Wwrite-strings)
-
-       ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS -Wall)
-       ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS -Wno-invalid-offsetof)
-       ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS -Wno-sign-compare)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_CAST_ALIGN -Wcast-align)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_DECLARATION_AFTER_STATEMENT -Wdeclaration-after-statement)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_DECLARATION_AFTER_STATEMENT -Werror=declaration-after-statement)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION -Werror=implicit-function-declaration)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_RETURN_TYPE -Werror=return-type)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_STRICT_PROTOTYPES -Werror=strict-prototypes)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_POINTER_ARITH -Wpointer-arith)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_PARAMETER -Wunused-parameter)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_WRITE_STRINGS -Wwrite-strings)
+
+       ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
+       ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
+       ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
 
 elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
 
-       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS -Wall)
-       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS -Wpointer-arith)
-       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS -Wno-unknown-pragmas)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_POINTER_ARITH -Wpointer-arith)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas)
 
-       ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS -Wall)
-       ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS -Wno-invalid-offsetof)
-       ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS -Wno-sign-compare)
+       ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
+       ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
+       ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
 
 endif()