diff options
author | Kevin Funk <kfunk@kde.org> | 2020-01-03 15:12:56 +0100 |
---|---|---|
committer | Kevin Funk <kfunk@kde.org> | 2020-02-07 12:03:22 +0100 |
commit | fafbc8cec665edf3b207162ceee87914d2beff0a (patch) | |
tree | 8987380d02369ca80612e3d84a89b456717443b0 /modules/ECMGeneratePriFile.cmake | |
parent | ee05317490571e5f4957dadb0263693049b722ff (diff) | |
download | extra-cmake-modules-fafbc8cec665edf3b207162ceee87914d2beff0a.tar.gz extra-cmake-modules-fafbc8cec665edf3b207162ceee87914d2beff0a.tar.bz2 |
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
Diffstat (limited to 'modules/ECMGeneratePriFile.cmake')
-rw-r--r-- | modules/ECMGeneratePriFile.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
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() |