diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-02-02 13:55:01 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-02-02 13:55:01 +0100 |
commit | 4b2ef72f0461fbce539d6a1bd69d8c0ed7041025 (patch) | |
tree | 6b311ffa86655f7c27aca88df59d125070bc32fb /sources/pyside2/cmake | |
parent | a5bc27c463f40f6c984f99f81bb05e46699c7df1 (diff) | |
parent | a18e81dd1311811eb1227cf46d253ae647a9fbdd (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.9
Change-Id: I777970f7bb17db766660d82556559eadd7293355
Diffstat (limited to 'sources/pyside2/cmake')
-rw-r--r-- | sources/pyside2/cmake/Macros/PySideModules.cmake | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sources/pyside2/cmake/Macros/PySideModules.cmake b/sources/pyside2/cmake/Macros/PySideModules.cmake index 83d43976a..36488912d 100644 --- a/sources/pyside2/cmake/Macros/PySideModules.cmake +++ b/sources/pyside2/cmake/Macros/PySideModules.cmake @@ -174,16 +174,22 @@ macro(check_qt_class module class optional_source_files dropped_entries) "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' # Force usage of the C++11 standard. CMAKE_CXX_STANDARD does not work with try_compile # but the issue has a fix in CMake 3.9. Thus we use a terrible workaround, we pass the C++ # standard flag the way CheckCXXSourceCompiles.cmake does it. - set(CUSTOM_CPP_STANDARD ${CMAKE_CXX11_EXTENSION_COMPILE_OPTION}) + + set(ADDITIONAL_FLAGS "${ADDITIONAL_FLAGS} -DQT_NO_VERSION_TAGGING ${CMAKE_CXX11_EXTENSION_COMPILE_OPTION}") 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=${CUSTOM_CPP_STANDARD}" + "-DCOMPILE_DEFINITIONS:STRING=${ADDITIONAL_FLAGS}" OUTPUT_VARIABLE OUTPUT) file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCheckQtClassTest.log ${OUTPUT}) |