Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PCH build failures #7613

Merged
merged 2 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ mark_as_advanced(Halide_CCACHE_BUILD)
if (Halide_CCACHE_BUILD)
find_program(CCACHE_PROGRAM ccache REQUIRED)

# TODO: ccache recommends setting CCACHE_SLOPPINESS=pch_defines,time_macros to
# enable precompiled header caching. Our timing found it slightly faster with
# just CCACHE_SLOPPINESS=pch_defines, so that's what we're using. Maybe revisit
# if issues occur (but we don't use any of the time macros so should be irrelevant).
set(Halide_CCACHE_PARAMS CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines
set(Halide_CCACHE_PARAMS
CCACHE_CPP2=yes
CCACHE_HASHDIR=yes
CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_mtime,include_file_ctime
CACHE STRING "Parameters to pass through to ccache")
mark_as_advanced(Halide_CCACHE_PARAMS)

Expand Down
7 changes: 7 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ add_executable(_test_internal internal.cpp)
target_link_libraries(_test_internal PRIVATE Halide::Test)
target_include_directories(_test_internal PRIVATE "${Halide_SOURCE_DIR}/src")
target_precompile_headers(_test_internal PRIVATE <Halide.h>)
if (Halide_CCACHE_BUILD)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(_test_internal PRIVATE
"$<$<COMPILE_LANGUAGE:CXX>:SHELL:-Xclang -fno-pch-timestamp>"
)
endif()
endif()

add_halide_test(_test_internal GROUPS internal)

Expand Down