Browse Source

generate position-independent code if supported

Ioannis Koutras 13 years ago
parent
commit
1efb9902de
1 changed files with 9 additions and 0 deletions
  1. 9 0
      src/CMakeLists.txt

+ 9 - 0
src/CMakeLists.txt

@@ -207,6 +207,8 @@ if (WITH_SHARED_LIB)
   set_target_properties(
     ${DMMLIB_SHARED_LIBRARY}
       PROPERTIES
+        POSITION_INDEPENDENT_CODE
+          ON
         OUTPUT_NAME
           dmm
   )
@@ -224,6 +226,13 @@ endif (WITH_SHARED_LIB)
 if (WITH_STATIC_LIB)
   add_library(${DMMLIB_STATIC_LIBRARY} STATIC ${dmmlib_SRCS})
 
+  set_target_properties(
+    ${DMMLIB_STATIC_LIBRARY}
+      PROPERTIES
+        POSITION_INDEPENDENT_CODE
+          ON
+  )
+
   install(
     TARGETS
       ${DMMLIB_STATIC_LIBRARY}