Alexandru Croitor 5b5fa7b75a CMake: Fix sqldrivers project to allow building as Debug MSVC config
When the user:
- has a non-developer-build -debug-and-release Qt
- and tries to configure the sqldrivers project with
  -DCMAKE_BUILD_TYPE=Debug
our build system discarded the user request, and defaulted to
'Release'.

That happens because CMake sets CMAKE_BUILD_TYPE_INIT to 'Debug' by
default on Windows-MSVC, and we have no marker to differentiate
that the 'Debug' value was user-specified.

We have such a marker
- via the
  __qt_auto_detect_cmake_build_type_before_project_call variable
  when configuring qtbase / top-level qt
- via the
  __qt_toolchain_cmake_build_type_before_project_call variable when
  configuring via the qt toolchain file (although that doesn't apply
  when configuring a multi-config build for obscure reasons, which
  should be addressed).

A conservative fix is to add a new variable / marker called
__qt_internal_standalone_project_cmake_build_type_before_project_call
which the 'sqldrivers' project will set with the build type that is
detected before the first project() call, and use that to decide
whether to override the build type, similar how we do with toolchain
file variable.

We could reuse one of the previous variables, but I figured it's better
to be explicit with a new one. And hopefully we can clean up the whole
logic in a follow-up commit.

Amends 48841c34d2e86a741ec9992b9704c0fa5973503c
Amends 8c912cddebe544010e7da3f87af5b21f3328d7ec

Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-120436
Task-number: QTBUG-114958
Change-Id: I37e3d8041088fe6084a9976ecc80ddd62d73ef81
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-01-23 14:26:21 +01:00
2020-11-16 10:02:08 +02:00
2024-01-22 14:51:21 +00:00
2023-12-20 00:44:28 +00:00
2023-12-11 17:35:40 +02:00
Description
Qt Base (Core, Gui, Widgets, Network, ...)
822 MiB
Languages
C++ 84.3%
HTML 4.9%
C 3.9%
CMake 3.6%
Objective-C++ 2%
Other 0.8%