aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2018-01-31 15:49:55 +0100
committerSimo Fält <simo.falt@qt.io>2018-02-02 10:21:16 +0000
commit0a478f1f631f701a008cf4552ec26cc7074e4f63 (patch)
tree41a657132c6a4639e95e1d806959d52aa9005ee7 /sources
parentdc9d1d1a3a96381ae6b7be2ea46840785986ae64 (diff)
Fix QSsl classes to be picked up on Linux
The compile tests that checked for QSsl classes silently failed because of two different reasons: 1) If Qt was compiled with -fPIC, but the tests weren't, we hit a compilation error. Solution is to compile with -fPIC if necessary. 2) For some reason when linking, the linker can't find the qt version tag symbol. Solution is to simply not use the version tag. Task-number: PYSIDE-599 Change-Id: If8a6ea38b45091bcaced6179a71195d25589ef18 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources')
-rw-r--r--sources/pyside2/cmake/Macros/PySideModules.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/sources/pyside2/cmake/Macros/PySideModules.cmake b/sources/pyside2/cmake/Macros/PySideModules.cmake
index 77653925e..0bef89b0c 100644
--- a/sources/pyside2/cmake/Macros/PySideModules.cmake
+++ b/sources/pyside2/cmake/Macros/PySideModules.cmake
@@ -155,10 +155,19 @@ macro(check_qt_class module class optional_source_files dropped_entries)
"${NAMESPACE_USE}\n"
"int main() { sizeof(${class}); }\n"
)
+
+ # Because Qt is built with -fPIC (by default), the compile tests also have to have that.
+ get_property(ADDITIONAL_FLAGS TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_OPTIONS)
+
+ # Don't add version tagging, because for some reason linker fails with:
+ # (.qtversion[qt_version_tag]+0x0): undefined reference to `qt_version_tag'
+ set(ADDITIONAL_FLAGS "${ADDITIONAL_FLAGS} -DQT_NO_VERSION_TAGGING")
+
try_compile(Q_WORKS ${CMAKE_BINARY_DIR}
${SRC_FILE}
CMAKE_FLAGS
"-DINCLUDE_DIRECTORIES=${QT_INCLUDE_DIR};${Qt5${_module_no_qt_prefix}_INCLUDE_DIRS}"
+ "-DCOMPILE_DEFINITIONS:STRING=${ADDITIONAL_FLAGS}"
OUTPUT_VARIABLE OUTPUT)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCheckQtClassTest.log ${OUTPUT})