CMake: Remove superfluous precompile_header feature and config test

Whether precompiled headers are used during the Qt build is controlled
by the CMake variable BUILD_WITH_PCH and the qt_auto_detect_pch
function.

The precompiled_header feature wasn't actually used. Remove it and the
corresponding configure test.

Fixes: QTBUG-134425
Change-Id: I9b2ff9cbcf4888899b6a39d22d260388a9375c5c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2025-03-05 17:04:27 +01:00
parent 9df20860de
commit 9f86517cce
5 changed files with 1 additions and 37 deletions

View File

@ -1,8 +0,0 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(precompile_header LANGUAGES CXX)
add_executable(precompile_header main.cpp)
target_precompile_headers(precompile_header PRIVATE header.h)

View File

@ -1,8 +0,0 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: BSD-3-Clause
#ifndef HEADER_H
#define HEADER_H
// Nothing to see here. We just want the HEADER_H define.
#endif

View File

@ -1,7 +0,0 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: BSD-3-Clause
#ifndef HEADER_H
# error no go
#endif
int main() {}

View File

@ -288,12 +288,6 @@ int main(void)
CXX_STANDARD 23
)
# precompile_header
qt_config_compile_test(precompile_header
LABEL "precompiled header support"
PROJECT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/precompile_header"
)
qt_config_compiler_supports_flag_test(optimize_debug
LABEL "-Og support"
FLAG "-Og"
@ -732,12 +726,6 @@ qt_feature("c++2b" PUBLIC
CONDITION QT_FEATURE_cxx20 AND (CMAKE_VERSION VERSION_GREATER_EQUAL "3.20") AND TEST_cxx2b
)
qt_feature_config("c++2b" QMAKE_PUBLIC_QT_CONFIG)
qt_feature("precompile_header"
LABEL "Using precompiled headers"
CONDITION BUILD_WITH_PCH AND TEST_precompile_header
AUTODETECT NOT WASM
)
qt_feature_config("precompile_header" QMAKE_PRIVATE_CONFIG)
set(__qt_ltcg_detected FALSE)
if(CMAKE_INTERPROCEDURAL_OPTIMIZATION)
set(__qt_ltcg_detected TRUE)
@ -1310,7 +1298,6 @@ qt_configure_add_summary_entry(
CONDITION GCC AND NOT CLANG AND ( QT_FEATURE_debug OR QT_FEATURE_force_debug_info OR QT_FEATURE_debug_and_release )
)
qt_configure_add_summary_entry(ARGS "relocatable")
qt_configure_add_summary_entry(ARGS "precompile_header")
qt_configure_add_summary_entry(ARGS "ltcg")
qt_configure_add_summary_entry(ARGS "intelcet")
qt_configure_add_summary_entry(ARGS "glibc_fortify_source")

View File

@ -107,7 +107,7 @@ qt_commandline_option(optimize-debug TYPE boolean NAME optimize_debug)
qt_commandline_option(optimize-size TYPE boolean NAME optimize_size)
qt_commandline_option(optimized-qmake TYPE boolean NAME release_tools)
qt_commandline_option(optimized-tools TYPE boolean NAME release_tools)
qt_commandline_option(pch TYPE boolean NAME precompile_header CMAKE_VARIABLE BUILD_WITH_PCH)
qt_commandline_option(pch TYPE boolean CMAKE_VARIABLE BUILD_WITH_PCH)
qt_commandline_option(pkg-config TYPE boolean)
qt_commandline_option(platform TYPE string CMAKE_VARIABLE QT_QMAKE_TARGET_MKSPEC)
qt_commandline_option(plugin-manifests TYPE boolean)