cmake build: Make separate debug info optional

In the CMake build in general, but still use it for
RelWithDebInfo builds with the build*.py scripts.

Fixes: QTCREATORBUG-25151
Change-Id: I8414f953278ebb395f73414c12af0ed7bd4fcdbe
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2020-12-22 11:20:43 +01:00
parent 03274561e9
commit 0f9a206bd5
4 changed files with 7 additions and 2 deletions

View File

@@ -36,6 +36,7 @@ set(_THIS_MODULE_BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
option(BUILD_PLUGINS_BY_DEFAULT "Build plugins by default. This can be used to build all plugins by default, or none." ON) option(BUILD_PLUGINS_BY_DEFAULT "Build plugins by default. This can be used to build all plugins by default, or none." ON)
option(BUILD_EXECUTABLES_BY_DEFAULT "Build executables by default. This can be used to build all executables by default, or none." ON) option(BUILD_EXECUTABLES_BY_DEFAULT "Build executables by default. This can be used to build all executables by default, or none." ON)
option(BUILD_LIBRARIES_BY_DEFAULT "Build libraries by default. This can be used to build all libraries by default, or none." ON) option(BUILD_LIBRARIES_BY_DEFAULT "Build libraries by default. This can be used to build all libraries by default, or none." ON)
option(QTC_SEPARATE_DEBUG_INFO "Extract debug information from binary files." OFF)
function(qtc_plugin_enabled varName name) function(qtc_plugin_enabled varName name)
if (NOT (name IN_LIST __QTC_PLUGINS)) if (NOT (name IN_LIST __QTC_PLUGINS))

View File

@@ -3,9 +3,9 @@ set(CMAKE_CURRENT_FUNCTION_LIST_DIR ${CMAKE_CURRENT_LIST_DIR})
endif() endif()
# Enable separate debug information for the given target # Enable separate debug information for the given target
# when doing RelWithDebInfo build # when QTC_SEPARATE_DEBUG_INFO is set
function(qtc_enable_separate_debug_info target installDestination) function(qtc_enable_separate_debug_info target installDestination)
if (NOT CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo) if (NOT QTC_SEPARATE_DEBUG_INFO)
return() return()
endif() endif()
if (NOT UNIX AND NOT MINGW) if (NOT UNIX AND NOT MINGW)

View File

@@ -119,9 +119,11 @@ def build_qtcreator(args, paths):
with_docs_str = 'OFF' if args.no_docs else 'ON' with_docs_str = 'OFF' if args.no_docs else 'ON'
build_date_option = 'OFF' if args.no_build_date else 'ON' build_date_option = 'OFF' if args.no_build_date else 'ON'
test_option = 'ON' if args.with_tests else 'OFF' test_option = 'ON' if args.with_tests else 'OFF'
separate_debug_info_option = 'ON' if args.with_debug_info else 'OFF'
cmake_args = ['cmake', cmake_args = ['cmake',
'-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths), '-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths),
'-DCMAKE_BUILD_TYPE=' + args.build_type, '-DCMAKE_BUILD_TYPE=' + args.build_type,
'-DQTC_SEPARATE_DEBUG_INFO=' + separate_debug_info_option,
'-DSHOW_BUILD_DATE=' + build_date_option, '-DSHOW_BUILD_DATE=' + build_date_option,
'-DWITH_DOCS=' + with_docs_str, '-DWITH_DOCS=' + with_docs_str,
'-DBUILD_DEVELOPER_DOCS=' + with_docs_str, '-DBUILD_DEVELOPER_DOCS=' + with_docs_str,

View File

@@ -70,9 +70,11 @@ def build(args, paths):
os.makedirs(paths.result) os.makedirs(paths.result)
prefix_paths = [os.path.abspath(fp) for fp in args.prefix_paths] + [paths.qt_creator, paths.qt] prefix_paths = [os.path.abspath(fp) for fp in args.prefix_paths] + [paths.qt_creator, paths.qt]
prefix_paths = [common.to_posix_path(fp) for fp in prefix_paths] prefix_paths = [common.to_posix_path(fp) for fp in prefix_paths]
separate_debug_info_option = 'ON' if args.with_debug_info else 'OFF'
cmake_args = ['cmake', cmake_args = ['cmake',
'-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths), '-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths),
'-DCMAKE_BUILD_TYPE=' + args.build_type, '-DCMAKE_BUILD_TYPE=' + args.build_type,
'-DQTC_SEPARATE_DEBUG_INFO=' + separate_debug_info_option,
'-DCMAKE_INSTALL_PREFIX=' + common.to_posix_path(paths.install), '-DCMAKE_INSTALL_PREFIX=' + common.to_posix_path(paths.install),
'-G', 'Ninja'] '-G', 'Ninja']