From fafbc8cec665edf3b207162ceee87914d2beff0a Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Fri, 3 Jan 2020 15:12:56 +0100 Subject: ECMGeneratePriFile: Fix static configurations Summary: Populate module_config with staticlib. This is needed for Qt 5.12, as Makefiles contain the full path to the library instead of just the base name. QMake needs to be aware of the build type. This issue was found in KDStateMachineEditor's .pri files. Before this patch the linker tried to link against .so files even for static libraries. Note: Probably not very relevenat to KDE Frameworks (since it's all about shared libraries, but I'd like to keep the original ECMGeneratePriFile version up-to-date) Compare: ``` % cat kdsme-qmake-test.pro QT += KDSMEDebugInterfaceSource !qtHaveModule(KDSMEDebugInterfaceSource): warning("Library not found") SOURCES += main.cpp % qmake --version QMake version 3.1 Using Qt version 5.9.8 in /home/kfunk/devel/build/qt5.9/qtbase/lib % qmake . % make ... g++ -Wl,-rpath,/home/kfunk/devel/build/qt5.9/qtbase/lib ... -L.../lib -lkdstatemachineeditor_debuginterfacesource ... % make clean % env-qt5.12 % qmake --version QMake version 3.1 Using Qt version 5.12.5 in /home/kfunk/devel/build/qt5.12/qtbase/lib % qmake . % make ... g++ -Wl,-rpath,/home/kfunk/devel/build/qt5.12/qtbase/lib ... .../lib/libkdstatemachineeditor_debuginterfacesource.a ... Reviewers: dfaure, winterz, vkrause, apol Reviewed By: apol Subscribers: kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D26394 --- modules/ECMGeneratePriFile.cmake | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'modules/ECMGeneratePriFile.cmake') diff --git a/modules/ECMGeneratePriFile.cmake b/modules/ECMGeneratePriFile.cmake index 645bd5ee..71ab9b94 100644 --- a/modules/ECMGeneratePriFile.cmake +++ b/modules/ECMGeneratePriFile.cmake @@ -179,6 +179,12 @@ function(ECM_GENERATE_PRI_FILE) set(${EGPF_FILENAME_VAR} ${PRI_FILENAME} PARENT_SCOPE) endif() + set(PRI_TARGET_MODULE_CONFIG "") + get_target_property(target_type ${EGPF_LIB_NAME} TYPE) + if (target_type STREQUAL "STATIC_LIBRARY") + set(PRI_TARGET_MODULE_CONFIG "staticlib") + endif() + file(GENERATE OUTPUT ${PRI_FILENAME} CONTENT @@ -193,6 +199,7 @@ QT.${PRI_TARGET_BASENAME}.includes = ${PRI_TARGET_INCLUDES} QT.${PRI_TARGET_BASENAME}.private_includes = QT.${PRI_TARGET_BASENAME}.libs = ${PRI_TARGET_LIBS} QT.${PRI_TARGET_BASENAME}.depends = ${PRI_TARGET_QTDEPS} +QT.${PRI_TARGET_BASENAME}.module_config = ${PRI_TARGET_MODULE_CONFIG} " ) endfunction() -- cgit v1.2.1