File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,25 @@ FUNCTION(EXCLUDE_DIR list_name dir_name)
1818ENDFUNCTION ()
1919
2020################################################################################
21+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
22+
23+ INCLUDE (CheckCXXSourceCompiles)
24+
25+ CHECK_CXX_SOURCE_COMPILES("
26+ #include <thread>
27+
28+ thread_local int foo=1;
29+
30+ int main() {
31+ return 0;
32+ }" HAS_THREAD_LOCAL)
33+
34+ IF (NOT HAS_THREAD_LOCAL)
35+ MESSAGE (FATAL_ERROR "thread_local not supported. THD requires a compiler"
36+ " that supports thread_local. Please upgrade your "
37+ "compiler. If you are on OSX, upgrade to "
38+ "XCode 8 or newer." )
39+ ENDIF (NOT HAS_THREAD_LOCAL)
2140
2241FIND_PACKAGE (MPI)
2342
@@ -101,7 +120,6 @@ EXCLUDE_DIR(all_cpp ".*/generic/.*\\.cpp$")
101120INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR} )
102121
103122ADD_LIBRARY (THD SHARED ${all_cpp} )
104- SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
105123
106124IF (THD_SO_VERSION)
107125 MESSAGE (STATUS "THD_SO_VERSION: ${THD_SO_VERSION} " )
You can’t perform that action at this time.
0 commit comments