Make sure linking static python exports all of its symbols

* This is needed to correctly load C modules like math, ctypes, etc
This commit is contained in:
baldurk
2017-04-19 16:21:46 +01:00
parent 94e64a0aec
commit 9441e15ebc
+8 -1
View File
@@ -80,6 +80,13 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
find_package(PySide2)
set(PYTHON_LINK "${PYTHON_LIBRARY}")
# ensure we link the whole python library so that modules have all the exports they need
if(STATIC_QRENDERDOC)
set(PYTHON_LINK "-rdynamic -Wl,--whole-archive ${PYTHON_LINK} -Wl,--no-whole-archive")
endif()
# Output our configuration for qmake. We output this to a separate file so that
# the user can then open the qrenderdoc.pro in qt creator and be able to build
# with these configuration entries propagated for e.g. linking against libraries
@@ -101,7 +108,7 @@ file(WRITE
"\n"
# include and link against python
"INCLUDEPATH+=${PYTHON_INCLUDE_DIR}\n"
"LIBS+=${PYTHON_LIBRARY}\n"
"LIBS+=${PYTHON_LINK}\n"
"\n"
"RENDERDOC_VERSION=${RENDERDOC_VERSION}\n"
"\n"