瀏覽代碼

COMP: Since PythonQt wrapper library are static, make sure the flag -fPIC is passed.

That will avoid the classic compilation problem: relocation R_X86_64_32 against
`a local symbol' can not be used when making a shared object.
Jean-Christophe Fillion-Robin 14 年之前
父節點
當前提交
ce9d183bb0
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      CMake/ctkMacroBuildLib.cmake

+ 3 - 0
CMake/ctkMacroBuildLib.cmake

@@ -136,6 +136,9 @@ MACRO(ctkMacroBuildLib)
       KIT_PYTHONQT_SRCS "${MY_SRCS}" ${CTK_WRAP_PYTHONQT_FULL})
     ADD_LIBRARY(${lib_name}PythonQt STATIC ${KIT_PYTHONQT_SRCS})
     TARGET_LINK_LIBRARIES(${lib_name}PythonQt ${lib_name})
+    IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+      SET_TARGET_PROPERTIES(${lib_name}PythonQt PROPERTIES COMPILE_FLAGS "-fPIC")
+    ENDIF()
 
     # Update list of libraries wrapped with PythonQt
     SET(CTK_WRAPPED_LIBRARIES_PYTHONQT