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

[INFRA] Search for ccache earlier #49

Merged
merged 1 commit into from
Aug 21, 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
7 changes: 7 additions & 0 deletions cmake/configuration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION V
hibf_config_error ("Clang < 17 is not supported. The detected compiler version is ${CMAKE_CXX_COMPILER_VERSION}.")
endif ()

# ----------------------------------------------------------------------------
# ccache
# ----------------------------------------------------------------------------

include ("${HIBF_SOURCE_DIR}/test/cmake/hibf_require_ccache.cmake")
hibf_require_ccache ()

# ----------------------------------------------------------------------------
# Require C++20
# ----------------------------------------------------------------------------
Expand Down
5 changes: 2 additions & 3 deletions test/cmake/hibf_require_ccache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ macro (hibf_require_ccache)
set (HIBF_FPROFILE_ABS_PATH "-fprofile-abs-path")
if (HIBF_USE_CCACHE)
find_program (CCACHE_PROGRAM ccache)
find_package_message (CCACHE_PROGRAM_PRE "Finding program ccache" "[${CCACHE_PROGRAM}]")

if (NOT CCACHE_PROGRAM)
find_package_message (CCACHE_PROGRAM "Finding program ccache - Failed" "[${CCACHE_PROGRAM}]")
find_package_message (CCACHE_PROGRAM " Ccache program: not available" "[${CCACHE_PROGRAM}]")
else ()
find_package_message (CCACHE_PROGRAM "Finding program ccache - Success" "[${CCACHE_PROGRAM}]")
find_package_message (CCACHE_PROGRAM " Ccache program: available" "[${CCACHE_PROGRAM}]")
set (HIBF_FPROFILE_ABS_PATH "--ccache-skip -fprofile-abs-path")
# New option since cmake >= 3.4:
# https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_LAUNCHER.html
Expand Down
3 changes: 0 additions & 3 deletions test/coverage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
cmake_minimum_required (VERSION 3.10...3.22)
project (hibf_test_coverage CXX)

include (../cmake/hibf_require_ccache.cmake)
hibf_require_ccache ()

# Add a custom build type: Coverage

set (CMAKE_CXX_FLAGS_COVERAGE
Expand Down
1 change: 0 additions & 1 deletion test/header/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ macro (hibf_header_test component header_base_path exclude_regex)
unset (header_target)
endmacro ()

hibf_require_ccache ()
hibf_require_benchmark ()
hibf_require_test ()

Expand Down
1 change: 0 additions & 1 deletion test/hibf-test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ endif ()

include (hibf_test_component)
include (hibf_test_files)
include (hibf_require_ccache)
include (hibf_require_benchmark)
include (hibf_require_test)
include (hibf_add_subdirectories)
Expand Down
1 change: 0 additions & 1 deletion test/performance/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ macro (hibf_benchmark benchmark_cpp)
unset (test_name)
endmacro ()

hibf_require_ccache ()
hibf_require_benchmark ()

add_subdirectories ()
1 change: 0 additions & 1 deletion test/snippet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ macro (hibf_snippets test_name_prefix snippet_base_path)
endforeach ()
endmacro ()

hibf_require_ccache ()
hibf_require_test ()

hibf_snippets ("snippet" "${CMAKE_CURRENT_SOURCE_DIR}")
Expand Down
1 change: 0 additions & 1 deletion test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ macro (hibf_test unit_test_cpp)
unset (test_name)
endmacro ()

hibf_require_ccache ()
hibf_require_test ()

add_subdirectories ()
Expand Down
4 changes: 0 additions & 4 deletions util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,5 @@ FetchContent_Populate (sharg)
list (APPEND CMAKE_PREFIX_PATH "${sharg_SOURCE_DIR}/build_system")
find_package (sharg 1.0 REQUIRED)

## ccache
include ("${HIBF_ROOT_DIR}/test/cmake/hibf_require_ccache.cmake")
hibf_require_ccache ()

add_executable (fpr_quality fpr_quality.cpp)
target_link_libraries (fpr_quality seqan::hibf sharg::sharg)