diff Resources/CMake/Compiler.cmake @ 1901:50234539a0dd

ENABLE_PLUGINS_VERSION_SCRIPT
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 04 Jan 2016 14:20:41 +0100
parents 8040d56cb0b3
children 01de36d949c3
line wrap: on
line diff
--- a/Resources/CMake/Compiler.cmake	Mon Jan 04 13:17:22 2016 +0100
+++ b/Resources/CMake/Compiler.cmake	Mon Jan 04 14:20:41 2016 +0100
@@ -50,7 +50,12 @@
     ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR
     ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
   set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
-  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--version-script=${ORTHANC_ROOT}/Plugins/Samples/Common/VersionScript.map")
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
+
+  if (NOT DEFINED ENABLE_PLUGINS_VERSION_SCRIPT OR 
+      ENABLE_PLUGINS_VERSION_SCRIPT)
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${ORTHANC_ROOT}/Plugins/Samples/Common/VersionScript.map")
+  endif()
 
   # Remove the "-rdynamic" option
   # http://www.mail-archive.com/cmake@cmake.org/msg08837.html