With -pthread all necessary preprocessor definitions should be already set.
git-svn-id: https://svn.dealii.org/branches/branch_cmake@27768
0785d39b-7218-0410-832d-
ea1e28bc413d
ENDIF()
- #
- # In some cases, -threads (or whatever else command line option)
- # switches on some preprocessor flags. If this is not the case,
- # then define them explicitely.
- #
- ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
- CHECK_CXX_SOURCE_COMPILES(
- "
- #if !defined (_REENTRANT) && !defined (_THREAD_SAFE)
- # error Neither _REENTRANT nor _THREAD_SAFE were defined.
- nonsense
- #endif
- int main(){ return 0; }
- "
- DEAL_II_HAVE_MT_DEFINITIONS)
- STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
-
- IF(NOT DEAL_II_HAVE_MT_DEFINITIONS)
- LIST(APPEND DEAL_II_DEFINITIONS "_REENTRANT" "_THREAD_SAFE")
- ENDIF()
-
ENDIF(Threads_FOUND)
ENDMACRO()
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams