From af5a70785eaa96286544db537e113545f8e3a280 Mon Sep 17 00:00:00 2001 From: Muzychenko Andrey <33288308+k4zmu2a@users.noreply.github.com> Date: Wed, 15 Sep 2021 12:20:57 +0300 Subject: [PATCH] Enabled pch in CMake. No need to remove old pch includes. --- CMakeLists.txt | 17 ++++++++++++++++- SpaceCadetPinball/pch.cpp | 5 ----- 2 files changed, 16 insertions(+), 6 deletions(-) delete mode 100644 SpaceCadetPinball/pch.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index ad8cdb6..8f0d036 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,6 @@ set(SOURCE_FILES SpaceCadetPinball/partman.h SpaceCadetPinball/pb.cpp SpaceCadetPinball/pb.h - SpaceCadetPinball/pch.cpp SpaceCadetPinball/pch.h SpaceCadetPinball/pinball.cpp SpaceCadetPinball/pinball.h @@ -168,6 +167,22 @@ set(SOURCE_FILES add_executable(SpaceCadetPinball ${SOURCE_FILES}) +# Skip pch on foreign code +set_source_files_properties( + SpaceCadetPinball/imgui.cpp + SpaceCadetPinball/imgui_sdl.cpp + SpaceCadetPinball/imgui_draw.cpp + SpaceCadetPinball/imgui_widgets.cpp + SpaceCadetPinball/imgui_tables.cpp + SpaceCadetPinball/imgui_demo.cpp + SpaceCadetPinball/imgui_impl_sdl.cpp + PROPERTIES SKIP_PRECOMPILE_HEADERS 1 +) +target_precompile_headers(SpaceCadetPinball + PUBLIC + SpaceCadetPinball/pch.h +) + target_link_libraries(SpaceCadetPinball ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARY}) # On Windows, copy DLL to output diff --git a/SpaceCadetPinball/pch.cpp b/SpaceCadetPinball/pch.cpp deleted file mode 100644 index 3a3d12b..0000000 --- a/SpaceCadetPinball/pch.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// pch.cpp: source file corresponding to pre-compiled header; necessary for compilation to succeed - -#include "pch.h" - -// In general, ignore this file, but keep it around if you are using pre-compiled headers.