From 8e652e1586d0bb4877858cbef9882eb0f01fa005 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 7 Sep 2021 13:13:30 +0200 Subject: [PATCH] Do not build Qbs by default Compiling Qbs takes time and is not strictly necessary for the Qbs integration in Qt Creator. We still want to build it for the release, but let's not build it by default anymore. [ChangeLog][Building from Sources] Qbs is not built anymore by default. Pass -DBUILD_QBS=ON on the CMake command line to enable it. Change-Id: Ic5793e26c7f6a7ac92931777e5d77cef2c8bf888 Reviewed-by: Kai Koehne Reviewed-by: Qt CI Bot --- README.md | 3 +++ scripts/build.py | 17 ++++++++++------- src/shared/CMakeLists.txt | 8 +------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index d3f566f5c8d..6274362ab4d 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,9 @@ the first `cmake` call. If you want to build in release mode, change the build type to `-DCMAKE_BUILD_TYPE=Release`. You can also build with release optimizations but debug information with `-DCMAKE_BUILD_TYPE=RelWithDebInfo`. +You can find more options in the generated CMakeCache.txt file. For instance, +building of Qbs together with Qt Creator can be enabled with `-DBUILD_QBS=ON`. + Installation is not needed. It is however possible, using cmake --install . --prefix /path/to/qtcreator_install diff --git a/scripts/build.py b/scripts/build.py index 055a5aefe55..f96a9c5a3c7 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -85,6 +85,7 @@ def get_arguments(): parser.add_argument('--no-cdb', help='Skip cdbextension and the python dependency packaging step (Windows)', action='store_true', default=(not common.is_windows_platform())) + parser.add_argument('--no-qbs', help='Skip building Qbs as part of Qt Creator', action='store_true', default=False); parser.add_argument('--no-docs', help='Skip documentation generation', action='store_true', default=False) parser.add_argument('--no-build-date', help='Does not show build date in about dialog, for reproducible builds', @@ -151,27 +152,29 @@ def common_cmake_arguments(args): return cmake_args def build_qtcreator(args, paths): + def cmake_option(option): + return 'ON' if option else 'OFF' if args.no_qtcreator: return if not os.path.exists(paths.build): os.makedirs(paths.build) + build_qbs = (True if not args.no_qbs and os.path.exists(os.path.join(paths.src, 'src', 'shared', 'qbs', 'CMakeLists.txt')) + else False) prefix_paths = [os.path.abspath(fp) for fp in args.prefix_paths] + [paths.qt] if paths.llvm: prefix_paths += [paths.llvm] if paths.elfutils: prefix_paths += [paths.elfutils] prefix_paths = [common.to_posix_path(fp) for fp in prefix_paths] - with_docs_str = 'OFF' if args.no_docs else 'ON' - build_date_option = 'OFF' if args.no_build_date else 'ON' - test_option = 'ON' if args.with_tests else 'OFF' cmake_args = ['cmake', '-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths), - '-DSHOW_BUILD_DATE=' + build_date_option, - '-DWITH_DOCS=' + with_docs_str, - '-DBUILD_DEVELOPER_DOCS=' + with_docs_str, + '-DSHOW_BUILD_DATE=' + cmake_option(not args.no_build_date), + '-DWITH_DOCS=' + cmake_option(not args.no_docs), + '-DBUILD_QBS=' + cmake_option(build_qbs), + '-DBUILD_DEVELOPER_DOCS=' + cmake_option(not args.no_docs), '-DBUILD_EXECUTABLE_SDKTOOL=OFF', '-DCMAKE_INSTALL_PREFIX=' + common.to_posix_path(paths.install), - '-DWITH_TESTS=' + test_option] + '-DWITH_TESTS=' + cmake_option(args.with_tests)] cmake_args += common_cmake_arguments(args) if common.is_windows_platform(): diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt index 880430e3654..93409b0bf45 100644 --- a/src/shared/CMakeLists.txt +++ b/src/shared/CMakeLists.txt @@ -9,13 +9,7 @@ add_subdirectory(registryaccess) qtc_add_public_header(qtcreator_pch.h) qtc_add_public_header(qtcreator_gui_pch.h) -if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/qbs/CMakeLists.txt) - set(BUILD_QBS_DEFAULT YES) -else() - set(BUILD_QBS_DEFAULT FALSE) -endif() - -option(BUILD_QBS "Build Qbs together with Qt Creator" ${BUILD_QBS_DEFAULT}) +option(BUILD_QBS "Build Qbs together with Qt Creator" OFF) add_feature_info("Build Qbs" BUILD_QBS "") if (BUILD_QBS)