summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2020-12-18 18:58:38 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-12-21 19:42:00 +0000
commit5d6f2238548fe8415e84099fc14470e189c9e726 (patch)
tree03917d4b493537993dd9458489c2502fa1c5a17f /cmake
parentf815382114bce9c28468a770a6b6e342619b15c2 (diff)
CMake: Use Release build type by default
Use developer-build feature to set Debug build by default instead of .git folder detection Task-number: QTBUG-89410 Fixes: QTBUG-89476 Change-Id: I2a4f529299d4875e7b0eef5b41dd7a6b9402178b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit b4b33846b4dc703e637b7d365676345eda0da460) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtSetup.cmake14
1 files changed, 7 insertions, 7 deletions
diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake
index e08ce69947..c9ed45d5e8 100644
--- a/cmake/QtSetup.cmake
+++ b/cmake/QtSetup.cmake
@@ -5,8 +5,14 @@
set(QT_BUILDING_QT TRUE CACHE
TYPE STRING "When this is present and set to true, it signals that we are building Qt from source.")
+# Pre-calculate the developer_build feature if it's set by the user via INPUT_developer_build
+if(NOT FEATURE_developer_build AND INPUT_developer_build
+ AND NOT "${INPUT_developer_build}" STREQUAL "undefined")
+ set(FEATURE_developer_build ON)
+endif()
+
set(_default_build_type "Release")
-if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
+if(FEATURE_developer_build)
set(_default_build_type "Debug")
endif()
@@ -54,12 +60,6 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Do not relink dependent libraries when no header has changed:
set(CMAKE_LINK_DEPENDS_NO_SHARED ON)
-# Pre-calculate the developer_build feature if it's set by the user via INPUT_developer_build
-if(NOT FEATURE_developer_build AND INPUT_developer_build
- AND NOT "${INPUT_developer_build}" STREQUAL "undefined")
- set(FEATURE_developer_build ON)
-endif()
-
# Detect non-prefix builds: either when the qtbase install prefix is set to the binary dir
# or when a developer build is explicitly enabled and no install prefix is specified.
# This detection only happens when building qtbase, and later is propagated via the generated