CMake: Only build QtLibraryInfo if we are building tools

It is a dependency for qmake and qtpaths. If neither of them are
built, because building tools might be disabled, skip building the
library as well.

Pick-to: 6.8
Task-number: QTBUG-127334
Change-Id: I0f7d5bc9d9a4539a6d25f7c2d841e9b8978a83a3
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
Alexandru Croitor 2024-07-18 18:33:50 +02:00
parent aea0f89cfa
commit 82b2c51c3a

View File

@ -8,6 +8,7 @@
#####################################################################
# The common object library, that should be available regardless of the presence of qmake.
if(QT_WILL_BUILD_TOOLS)
qt_add_library(QtLibraryInfo OBJECT
library/proitems.cpp library/proitems.h
library/qmake_global.h
@ -50,6 +51,14 @@ target_compile_definitions(QtLibraryInfo PUBLIC
qt_internal_set_exceptions_flags(QtLibraryInfo OFF)
# Add QMAKE_VERSION_STR only if qmake is part of the build.
if(QT_FEATURE_qmake)
target_compile_definitions(QtLibraryInfo PUBLIC
QMAKE_VERSION_STR="3.1"
)
endif()
endif()
if(NOT QT_FEATURE_qmake)
return()
endif()
@ -118,11 +127,6 @@ qt_internal_add_docs(qmake
qt_internal_return_unless_building_tools()
# Add QMAKE_VERSION_STR only if qmake is part of the build.
target_compile_definitions(QtLibraryInfo PUBLIC
QMAKE_VERSION_STR="3.1"
)
#### Keys ignored in scope 1:.:.:qmake.pro:<TRUE>:
# _OPTION = "host_build"