VERY experimental Nintendo Switch 2 emulator
C++
nuke: Goodbye PCH, you will not be missed (#2821)
Caio Oliveira8fa36a7737e3
diff --git a/CMakeLists.txt b/CMakeLists.txtindex e51f9c7238..138425bd19 100644--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -212,11 +212,6 @@ cmake_dependent_option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFFoption(YUZU_TESTS "Compile tests" "${BUILD_TESTING}")-option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" OFF)-if (YUZU_USE_PRECOMPILED_HEADERS)- message(STATUS "Using Precompiled Headers.")- set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON)-endif()option(YUZU_ENABLE_LTO "Enable link-time optimization" OFF)if(YUZU_ENABLE_LTO)include(CheckIPOSupported)@@ -235,9 +230,6 @@ if(USE_CCACHE)message(STATUS "Found ccache at: ${CCACHE_BINARY}")set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_BINARY})set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_BINARY})- if (YUZU_USE_PRECOMPILED_HEADERS)- message(FATAL_ERROR "Precompiled headers are incompatible with ccache. Re-run CMake with -DYUZU_USE_PRECOMPILED_HEADERS=OFF.")- endif()else()message(WARNING "USE_CCACHE enabled, but no executable found at: ${CCACHE_PATH}")endif()diff --git a/docs/Options.md b/docs/Options.mdindex 708da51837..b4d4f5f6b3 100644--- a/docs/Options.md+++ b/docs/Options.md@@ -22,7 +22,6 @@ Notes:- `YUZU_USE_BUNDLED_FFMPEG` (ON for non-UNIX) Download (Windows, Android) or build (UNIX) bundled FFmpeg- `ENABLE_CUBEB` (ON) Enables the cubeb audio backend- `YUZU_TESTS` (ON) Compile tests - requires Catch2-- `YUZU_USE_PRECOMPILED_HEADERS` (ON for non-UNIX) Use precompiled headers- `YUZU_DOWNLOAD_ANDROID_VVL` (ON) Download validation layer binary for Android- `YUZU_ENABLE_LTO` (OFF) Enable link-time optimization* Not recommended on Windowsdiff --git a/src/CMakeLists.txt b/src/CMakeLists.txtindex 0f3c5cfd4b..3e8a822ad9 100644--- a/src/CMakeLists.txt+++ b/src/CMakeLists.txt@@ -62,9 +62,6 @@ if (MSVC AND NOT CXX_CLANG)/Zc:throwingNew/GT- # Modules- /experimental:module- # Explicitly disable module support due to conflicts with precompiled headers.-# External headers diagnostics/external:anglebrackets # Treats all headers included by #include <header>, where the header file is enclosed in angle brackets (< >), as external headers/external:W0 # Sets the default warning level to 0 for external headers, effectively disabling warnings for them.diff --git a/src/audio_core/CMakeLists.txt b/src/audio_core/CMakeLists.txtindex c9f8af7dc3..90ee460b55 100644--- a/src/audio_core/CMakeLists.txt+++ b/src/audio_core/CMakeLists.txt@@ -56,7 +56,6 @@ add_library(audio_core STATICout/audio_out.hout/audio_out_system.cppout/audio_out_system.h- precompiled_headers.hrenderer/audio_device.cpprenderer/audio_device.hrenderer/audio_renderer.h@@ -266,8 +265,4 @@ if(ANDROID)target_compile_definitions(audio_core PUBLIC HAVE_OBOE)endif()-if (YUZU_USE_PRECOMPILED_HEADERS)- target_precompile_headers(audio_core PRIVATE precompiled_headers.h)-endif()-create_target_directory_groups(audio_core)diff --git a/src/audio_core/precompiled_headers.h b/src/audio_core/precompiled_headers.hdeleted file mode 100644index aabae730bf..0000000000--- a/src/audio_core/precompiled_headers.h+++ /dev/null@@ -1,6 +0,0 @@-// SPDX-FileCopyrightText: 2022 yuzu Emulator Project-// SPDX-License-Identifier: GPL-2.0-or-later--#pragma once--#include "common/common_precompiled_headers.h"diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txtindex 21f2ab4ed4..b6b2931fd9 100644--- a/src/common/CMakeLists.txt+++ b/src/common/CMakeLists.txt@@ -36,7 +36,6 @@ add_library(cityhash.cppcityhash.hcommon_funcs.h- common_precompiled_headers.hcommon_types.hconcepts.hcontainer_hash.h@@ -102,7 +101,6 @@ add_library(param_package.hparent_of_member.hpoint.h- precompiled_headers.hquaternion.hrange_map.hrange_mutex.h@@ -270,8 +268,4 @@ if(ANDROID)target_link_libraries(common PRIVATE android)endif()-if(YUZU_USE_PRECOMPILED_HEADERS)- target_precompile_headers(common PRIVATE precompiled_headers.h)-endif()-create_target_directory_groups(common)diff --git a/src/common/common_precompiled_headers.h b/src/common/common_precompiled_headers.hdeleted file mode 100644index b7e719dfd1..0000000000--- a/src/common/common_precompiled_headers.h+++ /dev/null@@ -1,14 +0,0 @@-// SPDX-FileCopyrightText: 2022 yuzu Emulator Project-// SPDX-License-Identifier: GPL-2.0-or-later--#pragma once--#include <algorithm>-#include <array>-#include <chrono>-#include <memory>--#include <fmt/ranges.h>--#include "common/assert.h"-#include "common/common_types.h"diff --git a/src/common/precompiled_headers.h b/src/common/precompiled_headers.hdeleted file mode 100644index aabae730bf..0000000000--- a/src/common/precompiled_headers.h+++ /dev/null@@ -1,6 +0,0 @@-// SPDX-FileCopyrightText: 2022 yuzu Emulator Project-// SPDX-License-Identifier: GPL-2.0-or-later--#pragma once--#include "common/common_precompiled_headers.h"diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txtindex 1e5ba54e7b..452e5f42e4 100644--- a/src/core/CMakeLists.txt+++ b/src/core/CMakeLists.txt@@ -1146,7 +1146,6 @@ add_library(core STATICmemory/dmnt_cheat_vm.hperf_stats.cppperf_stats.h- precompiled_headers.hreporter.cppreporter.htools/freezer.cpp@@ -1272,9 +1271,4 @@ else()hle/service/ssl/ssl_backend_none.cpp)endif()--if (YUZU_USE_PRECOMPILED_HEADERS)- target_precompile_headers(core PRIVATE precompiled_headers.h)-endif()-create_target_directory_groups(core)diff --git a/src/core/precompiled_headers.h b/src/core/precompiled_headers.hdeleted file mode 100644index 30a31001de..0000000000--- a/src/core/precompiled_headers.h+++ /dev/null@@ -1,11 +0,0 @@-// SPDX-FileCopyrightText: 2022 yuzu Emulator Project-// SPDX-License-Identifier: GPL-2.0-or-later--#pragma once--#include <boost/container/flat_map.hpp> // used by service.h which is heavily included-#include <boost/intrusive/rbtree.hpp> // used by k_auto_object.h which is heavily included--#include "common/common_precompiled_headers.h"--#include "core/hle/kernel/k_process.h"diff --git a/src/dedicated_room/CMakeLists.txt b/src/dedicated_room/CMakeLists.txtindex 5166329156..3e0658a1fb 100644--- a/src/dedicated_room/CMakeLists.txt+++ b/src/dedicated_room/CMakeLists.txt@@ -8,7 +8,6 @@# SPDX-License-Identifier: GPL-3.0-or-lateradd_library(yuzu-room STATIC EXCLUDE_FROM_ALL- precompiled_headers.hyuzu_room.cppyuzu_room.hyuzu_room.rc@@ -26,8 +25,4 @@ if (MSVC)endif()target_link_libraries(yuzu-room PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)-if (YUZU_USE_PRECOMPILED_HEADERS)- target_precompile_headers(yuzu-room PRIVATE precompiled_headers.h)-endif()-create_target_directory_groups(yuzu-room)diff --git a/src/dedicated_room/precompiled_headers.h b/src/dedicated_room/precompiled_headers.hdeleted file mode 100644index aabae730bf..0000000000--- a/src/dedicated_room/precompiled_headers.h+++ /dev/null@@ -1,6 +0,0 @@-// SPDX-FileCopyrightText: 2022 yuzu Emulator Project-// SPDX-License-Identifier: GPL-2.0-or-later--#pragma once--#include "common/common_precompiled_headers.h"diff --git a/src/dynarmic/CMakeLists.txt b/src/dynarmic/CMakeLists.txtindex 725a1aa2cd..66f9b1f5cd 100644--- a/src/dynarmic/CMakeLists.txt+++ b/src/dynarmic/CMakeLists.txt@@ -24,8 +24,6 @@ option(DYNARMIC_IGNORE_ASSERTS "Ignore asserts" OFF)option(DYNARMIC_TESTS_USE_UNICORN "Enable fuzzing tests against unicorn" OFF)CMAKE_DEPENDENT_OPTION(DYNARMIC_USE_LLVM "Support disassembly of jitted x86_64 code using LLVM" OFF "NOT YUZU_DISABLE_LLVM" OFF)-option(DYNARMIC_USE_PRECOMPILED_HEADERS "Use precompiled headers" OFF)-option(DYNARMIC_INSTALL "Install dynarmic headers and CMake files" OFF)option(DYNARMIC_USE_BUNDLED_EXTERNALS "Use all bundled externals (useful when e.g. cross-compiling)" OFF)option(DYNARMIC_ENABLE_LTO "Enable LTO" OFF)diff --git a/src/dynarmic/src/dynarmic/CMakeLists.txt b/src/dynarmic/src/dynarmic/CMakeLists.txtindex f21000044e..4e00e8fe0d 100644--- a/src/dynarmic/src/dynarmic/CMakeLists.txt+++ b/src/dynarmic/src/dynarmic/CMakeLists.txt@@ -410,15 +410,3 @@ target_compile_definitions(dynarmic PRIVATE FMT_USE_USER_DEFINED_LITERALS=1)if (DYNARMIC_ENABLE_LTO)set_property(TARGET dynarmic PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)endif()--if (DYNARMIC_USE_PRECOMPILED_HEADERS)- set(PRECOMPILED_HEADERS "$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/ir/ir_emitter.h>")- if ("x86_64" IN_LIST ARCHITECTURE)- list(PREPEND PRECOMPILED_HEADERS "$<$<COMPILE_LANGUAGE:CXX>:<xbyak/xbyak.h$<ANGLE-R>>")- endif()- if ("arm64" IN_LIST ARCHITECTURE)- list(PREPEND PRECOMPILED_HEADERS "$<$<COMPILE_LANGUAGE:CXX>:<oaknut/oaknut.hpp$<ANGLE-R>>")- endif()- target_precompile_headers(dynarmic PRIVATE ${PRECOMPILED_HEADERS})- set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON)-endif()diff --git a/src/hid_core/CMakeLists.txt b/src/hid_core/CMakeLists.txtindex 2699e1599e..26d9ec1d3f 100644--- a/src/hid_core/CMakeLists.txt+++ b/src/hid_core/CMakeLists.txt@@ -134,7 +134,6 @@ add_library(hid_core STATIChid_result.hhid_types.hhid_util.h- precompiled_headers.hresource_manager.cppresource_manager.h)@@ -160,7 +159,3 @@ endif()create_target_directory_groups(hid_core)target_link_libraries(hid_core PUBLIC core)--if (YUZU_USE_PRECOMPILED_HEADERS)- target_precompile_headers(hid_core PRIVATE precompiled_headers.h)-endif()diff --git a/src/hid_core/precompiled_headers.h b/src/hid_core/precompiled_headers.hdeleted file mode 100644index aabae730bf..0000000000--- a/src/hid_core/precompiled_headers.h+++ /dev/null@@ -1,6 +0,0 @@-// SPDX-FileCopyrightText: 2022 yuzu Emulator Project-// SPDX-License-Identifier: GPL-2.0-or-later--#pragma once--#include "common/common_precompiled_headers.h"diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txtindex f49db2ea3c..30ccd7e8c1 100644--- a/src/input_common/CMakeLists.txt+++ b/src/input_common/CMakeLists.txt@@ -35,7 +35,6 @@ add_library(input_common STATICinput_poller.hmain.cppmain.h- precompiled_headers.h)if (MSVC)@@ -92,10 +91,6 @@ endif()create_target_directory_groups(input_common)target_link_libraries(input_common PUBLIC hid_core PRIVATE common Boost::headers)-if (YUZU_USE_PRECOMPILED_HEADERS)- target_precompile_headers(input_common PRIVATE precompiled_headers.h)-endif()-if (ANDROID)target_sources(input_common PRIVATEdrivers/android.cppdiff --git a/src/input_common/precompiled_headers.h b/src/input_common/precompiled_headers.hdeleted file mode 100644index aabae730bf..0000000000--- a/src/input_common/precompiled_headers.h+++ /dev/null@@ -1,6 +0,0 @@-// SPDX-FileCopyrightText: 2022 yuzu Emulator Project-// SPDX-License-Identifier: GPL-2.0-or-later--#pragma once--#include "common/common_precompiled_headers.h"diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txtindex 598cc2e1be..24b752ccc5 100644--- a/src/network/CMakeLists.txt+++ b/src/network/CMakeLists.txt@@ -11,7 +11,6 @@ add_library(network STATICnetwork.hpacket.cpppacket.h- precompiled_headers.hroom.cpproom.hroom_member.cpp@@ -32,7 +31,3 @@ endif()if (PLATFORM_SUN)target_link_libraries(network PRIVATE socket nsl)endif()--if (YUZU_USE_PRECOMPILED_HEADERS)- target_precompile_headers(network PRIVATE precompiled_headers.h)-endif()diff --git a/src/network/precompiled_headers.h b/src/network/precompiled_headers.hdeleted file mode 100644index aabae730bf..0000000000--- a/src/network/precompiled_headers.h+++ /dev/null@@ -1,6 +0,0 @@-// SPDX-FileCopyrightText: 2022 yuzu Emulator Project-// SPDX-License-Identifier: GPL-2.0-or-later--#pragma once--#include "common/common_precompiled_headers.h"diff --git a/src/shader_recompiler/CMakeLists.txt b/src/shader_recompiler/CMakeLists.txtindex 79a4bf4fd2..4f19e00ee4 100644--- a/src/shader_recompiler/CMakeLists.txt+++ b/src/shader_recompiler/CMakeLists.txt@@ -237,7 +237,6 @@ add_library(shader_recompiler STATICir_opt/vendor_workaround_pass.cppir_opt/verification_pass.cppobject_pool.h- precompiled_headers.hprofile.hprogram_header.hruntime_info.h@@ -266,7 +265,3 @@ else()endif()create_target_directory_groups(shader_recompiler)--if (YUZU_USE_PRECOMPILED_HEADERS)- target_precompile_headers(shader_recompiler PRIVATE precompiled_headers.h)-endif()diff --git a/src/shader_recompiler/precompiled_headers.h b/src/shader_recompiler/precompiled_headers.hdeleted file mode 100644index 5dd6b7eca3..0000000000--- a/src/shader_recompiler/precompiled_headers.h+++ /dev/null@@ -1,7 +0,0 @@-// SPDX-FileCopyrightText: 2022 yuzu Emulator Project-// SPDX-License-Identifier: GPL-2.0-or-later--#pragma once--#include "common/common_precompiled_headers.h"-#include "frontend/maxwell/translate/impl/impl.h"diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txtindex c1fdd374ef..b6af1fa750 100644--- a/src/tests/CMakeLists.txt+++ b/src/tests/CMakeLists.txt@@ -17,7 +17,6 @@ add_executable(testscommon/unique_function.cppcore/core_timing.cppcore/internal_network/network.cpp- precompiled_headers.hvideo_core/memory_tracker.cppinput_common/calibration_configuration_job.cpp)@@ -28,7 +27,3 @@ target_link_libraries(tests PRIVATE common core input_common video_core)target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} Catch2::Catch2WithMain Threads::Threads)add_test(NAME tests COMMAND tests)--if (YUZU_USE_PRECOMPILED_HEADERS)- target_precompile_headers(tests PRIVATE precompiled_headers.h)-endif()diff --git a/src/tests/precompiled_headers.h b/src/tests/precompiled_headers.hdeleted file mode 100644index aabae730bf..0000000000--- a/src/tests/precompiled_headers.h+++ /dev/null@@ -1,6 +0,0 @@-// SPDX-FileCopyrightText: 2022 yuzu Emulator Project-// SPDX-License-Identifier: GPL-2.0-or-later--#pragma once--#include "common/common_precompiled_headers.h"diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txtindex 4a168241a4..444e0461f1 100644--- a/src/video_core/CMakeLists.txt+++ b/src/video_core/CMakeLists.txt@@ -102,7 +102,6 @@ add_library(video_core STATICinvalidation_accumulator.hmemory_manager.cppmemory_manager.h- precompiled_headers.hpresent.hpte_kind.hquery_cache/bank_base.h@@ -395,10 +394,6 @@ if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64)target_link_libraries(video_core PRIVATE dynarmic::dynarmic)endif()-if (YUZU_USE_PRECOMPILED_HEADERS)- target_precompile_headers(video_core PRIVATE precompiled_headers.h)-endif()-if (ANDROID AND ARCHITECTURE_arm64)target_link_libraries(video_core PRIVATE adrenotools)endif()diff --git a/src/video_core/precompiled_headers.h b/src/video_core/precompiled_headers.hdeleted file mode 100644index aabae730bf..0000000000--- a/src/video_core/precompiled_headers.h+++ /dev/null@@ -1,6 +0,0 @@-// SPDX-FileCopyrightText: 2022 yuzu Emulator Project-// SPDX-License-Identifier: GPL-2.0-or-later--#pragma once--#include "common/common_precompiled_headers.h"diff --git a/src/web_service/CMakeLists.txt b/src/web_service/CMakeLists.txtindex af56502827..0dedad16f7 100644--- a/src/web_service/CMakeLists.txt+++ b/src/web_service/CMakeLists.txt@@ -4,7 +4,6 @@add_library(web_service STATICannounce_room_json.cppannounce_room_json.h- precompiled_headers.hverify_login.cppverify_login.hverify_user_jwt.cpp@@ -21,7 +20,3 @@ target_link_libraries(web_service PRIVATE common network nlohmann_json::nlohmannfind_package(OpenSSL REQUIRED)target_link_libraries(web_service PRIVATE OpenSSL::SSL OpenSSL::Crypto)target_compile_definitions(web_service PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)--if (YUZU_USE_PRECOMPILED_HEADERS)- target_precompile_headers(web_service PRIVATE precompiled_headers.h)-endif()diff --git a/src/web_service/precompiled_headers.h b/src/web_service/precompiled_headers.hdeleted file mode 100644index aabae730bf..0000000000--- a/src/web_service/precompiled_headers.h+++ /dev/null@@ -1,6 +0,0 @@-// SPDX-FileCopyrightText: 2022 yuzu Emulator Project-// SPDX-License-Identifier: GPL-2.0-or-later--#pragma once--#include "common/common_precompiled_headers.h"diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txtindex 0bb51b250e..4b1e87b6ed 100644--- a/src/yuzu/CMakeLists.txt+++ b/src/yuzu/CMakeLists.txt@@ -198,7 +198,6 @@ add_executable(yuzumultiplayer/state.cppmultiplayer/state.hmultiplayer/validation.h- precompiled_headers.hstartup_checks.cppstartup_checks.hset_play_time_dialog.cpp@@ -448,10 +447,6 @@ if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64)target_link_libraries(yuzu PRIVATE dynarmic::dynarmic)endif()-if (YUZU_USE_PRECOMPILED_HEADERS)- target_precompile_headers(yuzu PRIVATE precompiled_headers.h)-endif()-if (YUZU_ROOM)target_link_libraries(yuzu PRIVATE yuzu-room)endif()diff --git a/src/yuzu/precompiled_headers.h b/src/yuzu/precompiled_headers.hdeleted file mode 100644index aabae730bf..0000000000--- a/src/yuzu/precompiled_headers.h+++ /dev/null@@ -1,6 +0,0 @@-// SPDX-FileCopyrightText: 2022 yuzu Emulator Project-// SPDX-License-Identifier: GPL-2.0-or-later--#pragma once--#include "common/common_precompiled_headers.h"diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txtindex a60650bc19..211b3141c2 100644--- a/src/yuzu_cmd/CMakeLists.txt+++ b/src/yuzu_cmd/CMakeLists.txt@@ -24,7 +24,6 @@ add_executable(yuzu-cmdemu_window/emu_window_sdl2_null.hemu_window/emu_window_sdl2_vk.cppemu_window/emu_window_sdl2_vk.h- precompiled_headers.hsdl_config.cppsdl_config.hyuzu.cpp@@ -61,8 +60,4 @@ if (MSVC)copy_yuzu_SDL_deps(yuzu-cmd)endif()-if (YUZU_USE_PRECOMPILED_HEADERS)- target_precompile_headers(yuzu-cmd PRIVATE precompiled_headers.h)-endif()-create_target_directory_groups(yuzu-cmd)diff --git a/src/yuzu_cmd/precompiled_headers.h b/src/yuzu_cmd/precompiled_headers.hdeleted file mode 100644index aabae730bf..0000000000--- a/src/yuzu_cmd/precompiled_headers.h+++ /dev/null@@ -1,6 +0,0 @@-// SPDX-FileCopyrightText: 2022 yuzu Emulator Project-// SPDX-License-Identifier: GPL-2.0-or-later--#pragma once--#include "common/common_precompiled_headers.h"