summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorYuhang Zhao <zhaoyuhang@rankyee.com>2023-06-08 10:55:33 +0800
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-06-14 03:49:57 +0000
commitc41547247b09f44782fa77e1ae93dc43cde87627 (patch)
tree5706c7faca1c345d7d28b92e943762459bca5a4c /qmake
parentecdd82ac348b654a9fa9906fd2569246558c5697 (diff)
Re-fix QtLibraryInfo compilation issues
After the "CMake: make compile options consistent for Qt created libraries" revert, this part of the code also get reverted, however, it's not related to the revert reason: the user project's deprecation behavior is changed. So restore this code. We need this code to make sure we use the same parameters when compiling QtLibraryInfo, otherwise some compilers may complain about it, such as clang-cl. Change-Id: Ie50d4f820be3a2e950dd87902d794f1d2681b7a5 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 71c9b9f05b9e3d0d655db33e75207a90509849e1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/CMakeLists.txt15
1 files changed, 6 insertions, 9 deletions
diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt
index 0a10dd5dd2..41bf2c77d9 100644
--- a/qmake/CMakeLists.txt
+++ b/qmake/CMakeLists.txt
@@ -16,14 +16,14 @@ qt_add_library(QtLibraryInfo OBJECT
qmakelibraryinfo.cpp qmakelibraryinfo.h
)
+# Make sure we use same parameters when building QtLibraryInfo and other Qt libraries,
+# otherwise some compilers may have compilation errors, such as clang-cl.
+target_link_libraries(QtLibraryInfo PUBLIC PlatformCommonInternal)
+
+target_link_libraries(QtLibraryInfo PUBLIC Qt::CorePrivate)
+
qt_internal_add_sync_header_dependencies(QtLibraryInfo Core)
-set_target_properties(QtLibraryInfo PROPERTIES
- COMPILE_OPTIONS $<TARGET_PROPERTY:Qt::Core,INTERFACE_COMPILE_OPTIONS>
- COMPILE_DEFINITIONS $<TARGET_PROPERTY:Qt::Core,INTERFACE_COMPILE_DEFINITIONS>
- INCLUDE_DIRECTORIES $<TARGET_PROPERTY:Qt::Core,INTERFACE_INCLUDE_DIRECTORIES>
- INCLUDE_DIRECTORIES $<TARGET_PROPERTY:Qt::CorePrivate,INTERFACE_INCLUDE_DIRECTORIES>
-)
target_include_directories(QtLibraryInfo PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/library"
@@ -41,8 +41,6 @@ target_compile_definitions(QtLibraryInfo PUBLIC
PROEVALUATOR_FULL
QT_BUILD_QMAKE
QT_USE_QSTRINGBUILDER
- QT_NO_FOREACH
- QT_VERSION_STR="${PROJECT_VERSION}"
QT_HOST_MKSPEC="${QT_QMAKE_HOST_MKSPEC}"
QT_TARGET_MKSPEC="${QT_QMAKE_TARGET_MKSPEC}"
QT_HOST_DATADIR="${hostdatadir}"
@@ -100,7 +98,6 @@ qt_internal_add_tool(${target_name}
PRECOMPILED_HEADER
"qmake_pch.h"
LIBRARIES
- Qt::CorePrivate
QtLibraryInfo
)
qt_internal_return_unless_building_tools()