From 8babd61451bbdba2327677fd6d765019cd6ee672 Mon Sep 17 00:00:00 2001 From: Mia <81255505+Nils75owo@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:23:12 +0100 Subject: [PATCH] added pre compiled header (#66) * added pre compiled header * added cmake version check and updated readme --- Hurrican/CMakeLists.txt | 8 ++++++++ README.md | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Hurrican/CMakeLists.txt b/Hurrican/CMakeLists.txt index df4760db..139baf12 100644 --- a/Hurrican/CMakeLists.txt +++ b/Hurrican/CMakeLists.txt @@ -519,6 +519,14 @@ include_directories(${CMAKE_SOURCE_DIR}/src/SDLPort) include_directories(${CMAKE_SOURCE_DIR}/3rdparty/glm) add_executable(${PROJECT_NAME} ${HURRICAN_SOURCES}) +# Enable pre compiled headers for way better compile times +OPTION(USE_PRECOMPILED_HEADERS "Enable pre compiled headers for better compile times" ON) +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.16") + if(USE_PRECOMPILED_HEADERS) + target_precompile_headers(${PROJECT_NAME} PRIVATE src/stdafx.hpp) + endif() +endif() + OPTION(OPENMPT "Use OPENMPT for ImpulseTracker music file decoding" OFF) IF(OPENMPT) ADD_DEFINITIONS(-DUSE_OPENMPT) diff --git a/README.md b/README.md index 9c690fca..4eb78d77 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,10 @@ Sound * -DOPENMPT=ON : Use the libopenmpt code for music (SDL2_mixer uses libmodplug while SDL_mixer uses the lower quality mikmod engine) Generic -* -DFAST_RANDOM=OFF : Use standard C random function in place of the fast [LCG](https://en.wikipedia.org/wiki/Linear_congruential_generator) -* -DFAST_TRIG=ON : Use fast approximation for trigonometric functions -* -DDISABLE_EXCEPTIONS=ON : Disable exception handling to reduce binary size +* -DFAST_RANDOM=OFF : Use standard C random function in place of the fast [LCG](https://en.wikipedia.org/wiki/Linear_congruential_generator) +* -DFAST_TRIG=ON : Use fast approximation for trigonometric functions +* -DDISABLE_EXCEPTIONS=ON : Disable exception handling to reduce binary size +* -DUSE_PRECOMPILED_HEADERS=ON : Enable pre-compiled headers for better compile time Debug * -DDISABLE_MEMPOOLING=ON : Bypass pooled memory manager