Skip to content

Commit

Permalink
fix(build): workarond sccache
Browse files Browse the repository at this point in the history
- workaround for sccache issue: mozilla/sccache#2090
  • Loading branch information
tomconder committed Jun 17, 2024
1 parent adc0ae4 commit 107b385
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions sponge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,14 @@ find_package(Stb REQUIRED)
add_library(sponge ${HEADER_FILES} ${SOURCE_FILES})
add_library(sponge::sponge ALIAS sponge)

# pre-compiled header support
message(STATUS "Compiling using pre-compiled header support")
list(APPEND SOURCE_FILES src/spongepch.cpp)
target_precompile_headers(sponge PUBLIC src/spongepch.hpp)
set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON)
# workaround for sccache issue: https://github.com/mozilla/sccache/issues/2090
if ((NOT APPLE) OR (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU"))
# pre-compiled header support
message(STATUS "Compiling using pre-compiled header support")
list(APPEND SOURCE_FILES src/spongepch.cpp)
target_precompile_headers(sponge PUBLIC src/spongepch.hpp)
set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON)
endif ()

if (MSVC)
# hardening
Expand Down

0 comments on commit 107b385

Please sign in to comment.