mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add cmake option to skip comptime update
In VS Code, comptime forces the game to be relinked even when no code has changed. This is a bit of a nuisance when starting with the debugger in the C++ extension, adding around 5 seconds of startup time to the game.
This commit is contained in:
parent
22e2b97171
commit
0e307208f8
2 changed files with 20 additions and 20 deletions
|
|
@ -66,6 +66,7 @@ option(SRB2_CONFIG_TESTERS "Compile a build for testers." OFF)
|
||||||
option(SRB2_CONFIG_MOBJCONSISTANCY "Compile with MOBJCONSISTANCY defined." OFF)
|
option(SRB2_CONFIG_MOBJCONSISTANCY "Compile with MOBJCONSISTANCY defined." OFF)
|
||||||
option(SRB2_CONFIG_PACKETDROP "Compile with PACKETDROP defined." OFF)
|
option(SRB2_CONFIG_PACKETDROP "Compile with PACKETDROP defined." OFF)
|
||||||
option(SRB2_CONFIG_ZDEBUG "Compile with ZDEBUG defined." OFF)
|
option(SRB2_CONFIG_ZDEBUG "Compile with ZDEBUG defined." OFF)
|
||||||
|
option(SRB2_CONFIG_SKIP_COMPTIME "Skip regenerating comptime. To speed up iterative debug builds in IDEs." OFF)
|
||||||
# SRB2_CONFIG_PROFILEMODE is probably superceded by some CMake setting.
|
# SRB2_CONFIG_PROFILEMODE is probably superceded by some CMake setting.
|
||||||
option(SRB2_CONFIG_PROFILEMODE "Compile for profiling (GCC only)." OFF)
|
option(SRB2_CONFIG_PROFILEMODE "Compile for profiling (GCC only)." OFF)
|
||||||
option(SRB2_CONFIG_TRACY "Compile with Tracy profiling enabled" OFF)
|
option(SRB2_CONFIG_TRACY "Compile with Tracy profiling enabled" OFF)
|
||||||
|
|
|
||||||
|
|
@ -166,22 +166,24 @@ if(SRB2_CONFIG_ENABLE_WEBM_MOVIES)
|
||||||
target_sources(SRB2SDL2 PRIVATE m_avrecorder.cpp)
|
target_sources(SRB2SDL2 PRIVATE m_avrecorder.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# This updates the modification time for comptime.c at the
|
if(NOT SRB2_CONFIG_SKIP_COMPTIME)
|
||||||
# end of building so when the build system is ran next time,
|
# This updates the modification time for comptime.c at the
|
||||||
# that file gets flagged. comptime.c will always be rebuilt.
|
# end of building so when the build system is ran next time,
|
||||||
#
|
# that file gets flagged. comptime.c will always be rebuilt.
|
||||||
# This begs the question, why always rebuild comptime.c?
|
#
|
||||||
# Some things like the git commit must be checked each time
|
# This begs the question, why always rebuild comptime.c?
|
||||||
# the program is built. But the build system determines which
|
# Some things like the git commit must be checked each time
|
||||||
# files should be rebuilt before anything else. So
|
# the program is built. But the build system determines which
|
||||||
# comptime.c, which only needs to be rebuilt based on
|
# files should be rebuilt before anything else. So
|
||||||
# information known at build time, must be told to rebuild
|
# comptime.c, which only needs to be rebuilt based on
|
||||||
# before that information can be ascertained.
|
# information known at build time, must be told to rebuild
|
||||||
add_custom_command(
|
# before that information can be ascertained.
|
||||||
TARGET SRB2SDL2
|
add_custom_command(
|
||||||
POST_BUILD
|
TARGET SRB2SDL2
|
||||||
COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${CMAKE_CURRENT_SOURCE_DIR}/comptime.c
|
POST_BUILD
|
||||||
)
|
COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${CMAKE_CURRENT_SOURCE_DIR}/comptime.c
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# config.h is generated by this command. It should be done at
|
# config.h is generated by this command. It should be done at
|
||||||
# build time for accurate git information and before anything
|
# build time for accurate git information and before anything
|
||||||
|
|
@ -614,10 +616,7 @@ add_subdirectory(hud)
|
||||||
# strip debug symbols into separate file when using gcc.
|
# strip debug symbols into separate file when using gcc.
|
||||||
# to be consistent with Makefile, don't generate for OS X.
|
# to be consistent with Makefile, don't generate for OS X.
|
||||||
if((CMAKE_COMPILER_IS_GNUCC) AND NOT ("${CMAKE_SYSTEM_NAME}" MATCHES Darwin))
|
if((CMAKE_COMPILER_IS_GNUCC) AND NOT ("${CMAKE_SYSTEM_NAME}" MATCHES Darwin))
|
||||||
if((${CMAKE_BUILD_TYPE} MATCHES Debug) OR (${CMAKE_BUILD_TYPE} MATCHES RelWithDebInfo))
|
if(${CMAKE_BUILD_TYPE} MATCHES RelWithDebInfo)
|
||||||
if(${CMAKE_BUILD_TYPE} MATCHES Debug)
|
|
||||||
set(OBJCOPY_ONLY_KEEP_DEBUG "--only-keep-debug")
|
|
||||||
endif()
|
|
||||||
message(STATUS "Will make separate debug symbols in *.debug")
|
message(STATUS "Will make separate debug symbols in *.debug")
|
||||||
add_custom_command(TARGET SRB2SDL2 POST_BUILD
|
add_custom_command(TARGET SRB2SDL2 POST_BUILD
|
||||||
COMMAND ${OBJCOPY} ${OBJCOPY_ONLY_KEEP_DEBUG} $<TARGET_FILE:SRB2SDL2> $<TARGET_FILE:SRB2SDL2>.debug
|
COMMAND ${OBJCOPY} ${OBJCOPY_ONLY_KEEP_DEBUG} $<TARGET_FILE:SRB2SDL2> $<TARGET_FILE:SRB2SDL2>.debug
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue