From a15c7b7944a8e6116f30f33c4aeead7a7d5cc0c9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 17 May 2021 18:48:37 +0200 Subject: [PATCH] Build: Stop using precompiled headers (PCH) This had very bad interactions with ccache, often leading to rebuilds with 100% cache misses, etc. Ali says it wasn't that big of a speedup in the end anyway, so let's not bother with it. We can always bring it back in the future if it seems like a good idea. --- CMakeLists.txt | 1 - Kernel/CMakeLists.txt | 1 - Meta/CMake/precompile-headers.cmake | 9 -------- Meta/CMake/utils.cmake | 4 ---- Meta/Precompile/AK.h | 28 ------------------------- Userland/Libraries/LibJS/CMakeLists.txt | 3 --- 6 files changed, 46 deletions(-) delete mode 100644 Meta/CMake/precompile-headers.cmake delete mode 100644 Meta/Precompile/AK.h diff --git a/CMakeLists.txt b/CMakeLists.txt index ae7e29f035b..0c591256f24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,6 @@ option(ENABLE_ALL_THE_DEBUG_MACROS "Enable all debug macros to validate they sti option(ENABLE_COMPILETIME_FORMAT_CHECK "Enable compiletime format string checks" ON) option(ENABLE_PCI_IDS_DOWNLOAD "Enable download of the pci.ids database at build time" ON) option(BUILD_LAGOM "Build parts of the system targeting the host OS for fuzzing/testing" OFF) -option(PRECOMPILE_COMMON_HEADERS "Precompile some common headers to speedup compilation" OFF) option(ENABLE_KERNEL_LTO "Build the kernel with link-time optimization" OFF) add_custom_target(run diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index c95951e18b8..9a3c350ed04 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -383,7 +383,6 @@ endif() target_link_libraries(Kernel kernel_heap gcc stdc++) add_dependencies(Kernel boot kernel_heap) install(TARGETS Kernel RUNTIME DESTINATION boot) -serenity_add_ak_precompiled_headers_to_target(Kernel) add_custom_command( TARGET Kernel diff --git a/Meta/CMake/precompile-headers.cmake b/Meta/CMake/precompile-headers.cmake deleted file mode 100644 index 10064715d68..00000000000 --- a/Meta/CMake/precompile-headers.cmake +++ /dev/null @@ -1,9 +0,0 @@ -function(serenity_add_precompiled_header_to_target target header) - if (PRECOMPILE_COMMON_HEADERS AND COMMAND target_precompile_headers) - target_precompile_headers(${target} PRIVATE ${header}) - endif () -endfunction() - -function(serenity_add_ak_precompiled_headers_to_target target) - serenity_add_precompiled_header_to_target(${target} ${CMAKE_SOURCE_DIR}/Meta/Precompile/AK.h) -endfunction() diff --git a/Meta/CMake/utils.cmake b/Meta/CMake/utils.cmake index 150d169f6c2..a0c170e5c7f 100644 --- a/Meta/CMake/utils.cmake +++ b/Meta/CMake/utils.cmake @@ -1,5 +1,3 @@ -include(${CMAKE_SOURCE_DIR}/Meta/CMake/precompile-headers.cmake) - function(serenity_install_headers target_name) file(GLOB_RECURSE headers RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h") foreach(header ${headers}) @@ -32,7 +30,6 @@ function(serenity_lib target_name fs_name) add_library(${target_name} SHARED ${SOURCES} ${GENERATED_SOURCES}) install(TARGETS ${target_name} DESTINATION usr/lib) set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${fs_name}) - serenity_add_ak_precompiled_headers_to_target(${target_name}) serenity_generated_sources(${target_name}) endfunction() @@ -69,7 +66,6 @@ endfunction() function(serenity_bin target_name) add_executable(${target_name} ${SOURCES}) install(TARGETS ${target_name} RUNTIME DESTINATION bin) - serenity_add_ak_precompiled_headers_to_target(${target_name}) serenity_generated_sources(${target_name}) endfunction() diff --git a/Meta/Precompile/AK.h b/Meta/Precompile/AK.h deleted file mode 100644 index 6334f234ca1..00000000000 --- a/Meta/Precompile/AK.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2021, Ali Mohammad Pur - * - * SPDX-License-Identifier: BSD-2-Clause - */ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/Userland/Libraries/LibJS/CMakeLists.txt b/Userland/Libraries/LibJS/CMakeLists.txt index bcfd5a96f01..8098e2b9bc8 100644 --- a/Userland/Libraries/LibJS/CMakeLists.txt +++ b/Userland/Libraries/LibJS/CMakeLists.txt @@ -93,6 +93,3 @@ set(SOURCES serenity_lib(LibJS js) target_link_libraries(LibJS LibM LibCore LibCrypto LibRegex LibSyntax) - -serenity_add_precompiled_header_to_target(LibJS ${CMAKE_CURRENT_SOURCE_DIR}/Heap/Heap.h) -serenity_add_precompiled_header_to_target(LibJS ${CMAKE_CURRENT_SOURCE_DIR}/Runtime/GlobalObject.h)