Explorar o código

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 %!s(int64=15) %!d(string=hai) anos
pai
achega
ce9d183bb0
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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