From 53b11882c829ddb46c46ede2c010f6b49e86ae2b Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 30 Oct 2020 13:29:55 +0100 Subject: CMake: Cleanup module and plugin define situation The QT..DEFINES assignment in pri files needs to take into account the module name when computing the define name. This is the MODULE value that qmake specifies. In CMake that would be the value of CONFIG_MODULE_NAME. Previously the value of the define was computed in qt_internal_module_info() without taking into account the module name. While qt_internal_module_info() ended being used also for plugins and other target types, the defines computed by it were meant to be used only for Qt modules. Thus remove the _define assignment from qt_internal_module_info and move its computation directly into qt_internal_add_module, taking into account the value of CONFIG_MODULE_NAME. The only other use of module_define was in qt_internal_add_plugin but that was merely a long overdue copy-paste error, qmake doesn't propagate QT_FOO_LIB defines for plugins. As result, a define special case in testlib is not needed anymore, because the define is now computed properly. Finally, QT_FOO_LIB should not be used while building the Qt module itself, so instead of using PUBLIC_DEFINES option of qt_internal_extend_target, use target_compile_definitions(INTERFACE) directly. Change-Id: I4d44f7461bac2f0c09aec3e995d02dfe36e00883 Reviewed-by: Joerg Bornemann --- src/testlib/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'src/testlib') diff --git a/src/testlib/CMakeLists.txt b/src/testlib/CMakeLists.txt index 733f86b2c7..718c792dcc 100644 --- a/src/testlib/CMakeLists.txt +++ b/src/testlib/CMakeLists.txt @@ -60,7 +60,6 @@ qt_internal_add_module(Test QT_NO_CAST_TO_ASCII QT_NO_DATASTREAM QT_NO_FOREACH - QT_BUILD_TESTLIB_LIB # special case LIBRARIES Qt::CorePrivate PUBLIC_LIBRARIES -- cgit v1.2.3