Mercurial > hg > orthanc
comparison Resources/CMake/Compiler.cmake @ 1381:0d9812893262
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 29 May 2015 13:57:54 +0200 |
parents | 601d34afdab9 |
children | dae2e28951c6 |
comparison
equal
deleted
inserted
replaced
1380:31b884468b05 | 1381:0d9812893262 |
---|---|
69 | 69 |
70 if (${CMAKE_COMPILER_IS_GNUCXX}) | 70 if (${CMAKE_COMPILER_IS_GNUCXX}) |
71 # This is a patch for MinGW64 | 71 # This is a patch for MinGW64 |
72 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--allow-multiple-definition -static-libgcc -static-libstdc++") | 72 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--allow-multiple-definition -static-libgcc -static-libstdc++") |
73 | 73 |
74 # This line is necessary to compile with recent versions of MinGW, | 74 CHECK_LIBRARY_EXISTS(winpthread pthread_create "" HAVE_WIN_PTHREAD) |
75 # otherwise "libwinpthread-1.dll" is not statically linked. | 75 if (HAVE_WIN_PTHREAD) |
76 SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic") | 76 # This line is necessary to compile with recent versions of MinGW, |
77 # otherwise "libwinpthread-1.dll" is not statically linked. | |
78 SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic") | |
79 add_definitions(-DHAVE_WIN_PTHREAD=1) | |
80 else() | |
81 add_definitions(-DHAVE_WIN_PTHREAD=0) | |
82 endif() | |
77 endif() | 83 endif() |
78 | 84 |
79 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") | 85 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") |
80 add_definitions( | 86 add_definitions( |
81 -D_XOPEN_SOURCE=1 | 87 -D_XOPEN_SOURCE=1 |