diff options
Diffstat (limited to 'qmake/CMakeLists.txt')
-rw-r--r-- | qmake/CMakeLists.txt | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index d35d981c99..5a54570194 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + # Generated from qmake.pro. ##################################################################### @@ -5,19 +8,22 @@ ##################################################################### # The common object library, that should be available regardless of the presence of qmake. -add_library(QtLibraryInfo OBJECT +qt_add_library(QtLibraryInfo OBJECT library/proitems.cpp library/proitems.h library/qmake_global.h property.cpp property.h propertyprinter.cpp propertyprinter.h qmakelibraryinfo.cpp qmakelibraryinfo.h ) -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> -) + +# 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) + target_include_directories(QtLibraryInfo PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/library" @@ -29,24 +35,19 @@ if("${hostdatadir}" STREQUAL "") set(hostdatadir ".") endif() +qt_internal_library_deprecation_level(deprecation_define) + target_compile_definitions(QtLibraryInfo PUBLIC PROEVALUATOR_FULL QT_BUILD_QMAKE QT_USE_QSTRINGBUILDER - QT_NO_FOREACH - QT_VERSION_STR="${PROJECT_VERSION}" # special case - QT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} # special case - QT_VERSION_MINOR=${PROJECT_VERSION_MINOR} # special case - QT_VERSION_PATCH=${PROJECT_VERSION_PATCH} # special case QT_HOST_MKSPEC="${QT_QMAKE_HOST_MKSPEC}" QT_TARGET_MKSPEC="${QT_QMAKE_TARGET_MKSPEC}" QT_HOST_DATADIR="${hostdatadir}" + ${deprecation_define} ) -qt_set_common_target_properties(QtLibraryInfo) -# qmake is out of any module, so we manually evaluate the required features. -include("${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") -qt_feature_evaluate_features("${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") +qt_internal_set_exceptions_flags(QtLibraryInfo OFF) if(NOT QT_FEATURE_qmake) return() @@ -54,7 +55,8 @@ endif() qt_get_tool_target_name(target_name qmake) qt_internal_add_tool(${target_name} - TOOLS_TARGET Core # special case + TRY_RUN + TOOLS_TARGET Core USER_FACING INSTALL_VERSIONED_LINK SOURCES @@ -95,9 +97,12 @@ qt_internal_add_tool(${target_name} PRECOMPILED_HEADER "qmake_pch.h" LIBRARIES - Qt::CorePrivate QtLibraryInfo + NO_UNITY_BUILD_SOURCES + generators/win32/msvc_objectmodel.cpp # xml symbols clash with generators/win32/msbuild_objectmodel.cpp + library/qmakeparser.cpp # struct statics clashes with qmakeevaluator_p.h ) +qt_internal_return_unless_building_tools() # Add QMAKE_VERSION_STR only if qmake is part of the build. target_compile_definitions(QtLibraryInfo PUBLIC @@ -115,7 +120,6 @@ qt_internal_extend_target(${target_name} CONDITION MACOS "-fconstant-cfstrings" ) -# special case big qt_internal_extend_target(${target_name} CONDITION WIN32 SOURCES library/registry.cpp @@ -123,24 +127,15 @@ qt_internal_extend_target(${target_name} CONDITION WIN32 _SCL_SECURE_NO_WARNINGS ) -qt_internal_extend_target(${target_name} CONDITION CLANG AND WIN32 - COMPILE_OPTIONS - "-fms-compatibility-version=19.00.23506" - "-Wno-microsoft-enum-value" -) - -# special case: set_target_properties(${target_name} PROPERTIES AUTOMOC OFF AUTORCC OFF AUTOUIC OFF ) -qt_internal_apply_gc_binaries(${target_name} PRIVATE) # special case -qt_skip_warnings_are_errors(${target_name}) # special case +qt_internal_apply_gc_binaries(${target_name} PRIVATE) +qt_skip_warnings_are_errors(${target_name}) -# special case begin qt_internal_add_docs(${target_name} doc/qmake.qdocconf ) -# special case end |