comparison Plugins/Samples/Common/OrthancPlugins.cmake @ 1647:fe458dde986e

hide symbols in plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 25 Sep 2015 11:02:26 +0200
parents 97268448bdfc
children a412ad57f0f9
comparison
equal deleted inserted replaced
1646:da799f767e5d 1647:fe458dde986e
4 4
5 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") 5 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
6 link_libraries(uuid) 6 link_libraries(uuid)
7 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread") 7 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
8 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread") 8 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread")
9
9 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") 10 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
10 link_libraries(rpcrt4 ws2_32 secur32) 11 link_libraries(rpcrt4 ws2_32 secur32)
11 if (CMAKE_COMPILER_IS_GNUCXX) 12 if (CMAKE_COMPILER_IS_GNUCXX)
12 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++") 13 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++")
13 endif() 14 endif()
19 SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic") 20 SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic")
20 endif() 21 endif()
21 endif () 22 endif ()
22 23
23 24
25 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
26 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR
27 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
28 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${SAMPLES_ROOT}/Common/VersionScript.map -Wl,--no-undefined")
29 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
30 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -exported_symbols_list ${CMAKE_SOURCE_DIR}/Plugins/Samples/Common/ExportedSymbols.list")
31 endif()
32
33
24 if (CMAKE_COMPILER_IS_GNUCXX) 34 if (CMAKE_COMPILER_IS_GNUCXX)
25 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${SAMPLES_ROOT}/Common/VersionScript.map -Wl,--no-undefined")
26 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic") 35 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic")
27 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic") 36 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic")
28 endif() 37 endif()
29 38
30 39
32 # Linking with "pthread" is necessary, otherwise the software crashes 41 # Linking with "pthread" is necessary, otherwise the software crashes
33 # http://sourceware.org/bugzilla/show_bug.cgi?id=10652#c17 42 # http://sourceware.org/bugzilla/show_bug.cgi?id=10652#c17
34 link_libraries(dl rt) 43 link_libraries(dl rt)
35 endif() 44 endif()
36 45
37
38 include_directories(${SAMPLES_ROOT}/../Include/) 46 include_directories(${SAMPLES_ROOT}/../Include/)
39 47
40 if (MSVC) 48 if (MSVC)
41 include_directories(${SAMPLES_ROOT}/../../Resources/ThirdParty/VisualStudio/) 49 include_directories(${SAMPLES_ROOT}/../../Resources/ThirdParty/VisualStudio/)
42 endif() 50 endif()