Fix usage of BUILD_SHARED_LIBS in configure.cmake

Feature conditions that used BUILD_SHARED_LIBS evaluated to false,
e.g. FEATURE_framework. The options must be declared before the
configuration files are included.

Change-Id: I1ccda8234b334371d22e19f7f6d4fba3a1e7b857
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2019-11-07 08:51:03 +01:00 committed by Alexandru Croitor
parent 344e4ec827
commit 6b193c88a7

View File

@ -26,6 +26,16 @@ find_package(QtBuildInternals CMAKE_FIND_ROOT_PATH_BOTH)
unset(QT_BUILD_INTERNALS_SKIP_CMAKE_MODULE_PATH_ADDITION)
qt_build_repo_begin()
## Should this Qt be static or dynamically linked?
option(BUILD_SHARED_LIBS "Build Qt statically or dynamically" ON)
set(QT_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
## Should this Qt be built with Werror?
option(WARNINGS_ARE_ERRORS "Build Qt with warnings as errors" ${FEATURE_developer_build})
## Should Qt be built using PCH?
option(BUILD_WITH_PCH "Build Qt using precompiled headers?" ON)
## QtBase specific configure tests:
include(QtBaseConfigureTests)
@ -37,16 +47,6 @@ include(QtBaseGlobalTargets)
qt_set_language_standards()
## Should this Qt be static or dynamically linked?
option(BUILD_SHARED_LIBS "Build Qt statically or dynamically" ON)
set(QT_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
## Should this Qt be built with Werror?
option(WARNINGS_ARE_ERRORS "Build Qt with warnings as errors" ${FEATURE_developer_build})
## Should Qt be built using PCH?
option(BUILD_WITH_PCH "Build Qt using precompiled headers?" ON)
## Decide whether tools will be built.
qt_check_if_tools_will_be_built()