Skip to content

Commit 1a0f66f

Browse files
author
Semphris
committed
Make PCH optional
1 parent 89e389b commit 1a0f66f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

CMakeLists.txt

+6-2
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,12 @@ add_library(supertux2_c OBJECT ${SUPERTUX_SOURCES_C})
244244
add_library(supertux2_lib STATIC ${CMAKE_BINARY_DIR}/version.h ${SUPERTUX_SOURCES_CXX} ${SUPERTUX_RESOURCES} $<TARGET_OBJECTS:supertux2_c>)
245245
target_include_directories(supertux2_lib PUBLIC ${CMAKE_BINARY_DIR} src/)
246246

247-
file(GLOB_RECURSE SUPERTUX_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/**.hpp)
248-
target_precompile_headers(supertux2_lib PRIVATE ${SUPERTUX_HEADERS})
247+
# Pre-compiled headers
248+
option(SUPERTUX_PCH "Pre-compile headers (faster builds)" ON)
249+
if(SUPERTUX_PCH)
250+
file(GLOB_RECURSE SUPERTUX_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/**.hpp)
251+
target_precompile_headers(supertux2_lib PRIVATE ${SUPERTUX_HEADERS})
252+
endif()
249253

250254
if(WIN32)
251255
add_executable(supertux2 WIN32 src/main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.rc)

0 commit comments

Comments
 (0)