mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-13 22:22:05 +00:00
Fix rbdmap / idlib PCH mismatch and cleanup rbdmap PCH files after build
This commit is contained in:
parent
f6cd2386a7
commit
387c4a18e5
1 changed files with 34 additions and 0 deletions
|
@ -307,6 +307,12 @@ else()
|
|||
SEPARATE_ARGUMENTS(_compiler_FLAGS)
|
||||
|
||||
if (USE_PRECOMPILED_HEADERS)
|
||||
# SRS - USE_OPTICK not useful for rbdmap, but definition required to avoid mismatch with idlib precompiled header
|
||||
if(OPTICK)
|
||||
LIST(APPEND _compiler_FLAGS -DUSE_OPTICK=1)
|
||||
else()
|
||||
LIST(APPEND _compiler_FLAGS -DUSE_OPTICK=0)
|
||||
endif()
|
||||
add_custom_target(precomp_header_rbdmap ALL
|
||||
COMMAND ${CMAKE_CXX_COMPILER} ${_compiler_FLAGS} -x c++-header precompiled.h -o precompiled.h.gch
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
|
@ -318,6 +324,34 @@ else()
|
|||
add_dependencies(rbdmap idlib)
|
||||
if (USE_PRECOMPILED_HEADERS)
|
||||
add_dependencies(rbdmap precomp_header_rbdmap)
|
||||
|
||||
if(WIN32)
|
||||
set(remove_command "del")
|
||||
set(idlib_dir_slash "${CMAKE_SOURCE_DIR}\\idlib\\")
|
||||
else()
|
||||
set(remove_command "rm")
|
||||
set(idlib_dir_slash "${CMAKE_SOURCE_DIR}/idlib/")
|
||||
endif()
|
||||
|
||||
# SRS - delete precompiled header file after executable is compiled: command line build case
|
||||
if(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja")
|
||||
add_custom_target(rm_precomp_header_rbdmap ALL
|
||||
COMMAND ${remove_command} "precompiled.h.gch"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMENT "remove tools/compilers/precompiled.h.gch"
|
||||
)
|
||||
add_dependencies(rm_precomp_header_rbdmap rbdmap)
|
||||
|
||||
# SRS - delete precompiled header files after executable is compiled: IDE build case (e.g. Xcode)
|
||||
else()
|
||||
add_custom_command(TARGET rbdmap POST_BUILD
|
||||
# SRS - added wildcards to remove tmp files from cmake ZERO_CHECK regeneration
|
||||
COMMAND ${remove_command} "${idlib_dir_slash}precompiled.h*.gch*"
|
||||
COMMAND ${remove_command} "precompiled.h*.gch*"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMENT "remove idlib/precompiled.h.gch and tools/compilers/precompiled.h.gch"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
target_link_libraries(rbdmap idlib ${CURSES_NCURSES_LIBRARY} ${ZLIB_LIBRARY})
|
||||
|
||||
|
|
Loading…
Reference in a new issue