aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2
diff options
context:
space:
mode:
authorJulien Schueller <schueller@phimeca.com>2019-05-27 11:42:06 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-06-06 14:48:39 +0200
commita90adae275cef10dd75b8fc19bc97a7cb59c43dc (patch)
treeeb0d36e99edfdf3542ade9560e23f0547d9d8c59 /sources/shiboken2
parent419dfd45cf32403537547e7555c857ccf7c30ce1 (diff)
CMake: Change the default behavior CMAKE_BUILD_TYPE
Instead of setting CMAKE_BUILD_TYPE as a regular variable, set it as a cache value, but only as a default. If the user specifies -DCMAKE_BUILD_TYPE=Foo on the command line, that will take priority. PySide2 will inherit the build type from the shiboken build, also unless explicitly specified on the command line. Fix missing quotes around the build type in shiboken_helpers.cmake. Task-number: PYSIDE-980 Change-Id: I2f7e5f71b66467ca5b30056c42d26d9a54ff265b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2')
-rw-r--r--sources/shiboken2/CMakeLists.txt13
-rw-r--r--sources/shiboken2/data/shiboken_helpers.cmake2
2 files changed, 7 insertions, 8 deletions
diff --git a/sources/shiboken2/CMakeLists.txt b/sources/shiboken2/CMakeLists.txt
index 950aa6215..be1b4cd7f 100644
--- a/sources/shiboken2/CMakeLists.txt
+++ b/sources/shiboken2/CMakeLists.txt
@@ -1,10 +1,13 @@
Include(icecc.cmake)
-project(shiboken2)
-include(CheckIncludeFileCXX)
cmake_minimum_required(VERSION 3.1)
cmake_policy(VERSION 3.1)
+set(CMAKE_BUILD_TYPE Release CACHE STRING "Build Type")
+
+project(shiboken2)
+include(CheckIncludeFileCXX)
+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake_helpers/")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/data/")
@@ -404,11 +407,7 @@ execute_process(
OUTPUT_VARIABLE PYTHON_WITH_COUNT_ALLOCS
OUTPUT_STRIP_TRAILING_WHITESPACE)
-if(NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE Release)
-endif()
-
-set(SHIBOKEN_BUILD_TYPE "Release")
+set(SHIBOKEN_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(SHIBOKEN_BUILD_TYPE "Debug")
diff --git a/sources/shiboken2/data/shiboken_helpers.cmake b/sources/shiboken2/data/shiboken_helpers.cmake
index c55ee89fe..f4dd4d5dc 100644
--- a/sources/shiboken2/data/shiboken_helpers.cmake
+++ b/sources/shiboken2/data/shiboken_helpers.cmake
@@ -157,7 +157,7 @@ macro(shiboken_compute_python_libraries)
# If the resulting variable
# contains a "debug;X;optimized;Y" list like described in shiboken_check_if_limited_api,
# make sure to pick just one, so that the final generator expressions are valid.
- shiboken_get_library_for_current_config("${SHIBOKEN_PYTHON_LIBRARIES}" ${CMAKE_BUILD_TYPE} "SHIBOKEN_PYTHON_LIBRARIES")
+ shiboken_get_library_for_current_config("${SHIBOKEN_PYTHON_LIBRARIES}" "${CMAKE_BUILD_TYPE}" "SHIBOKEN_PYTHON_LIBRARIES")
if(APPLE)
set(SHIBOKEN_PYTHON_LIBRARIES "-undefined dynamic_lookup")