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

CMakeLists should not know anything about ccache #249

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 0 additions & 7 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
find_program(CCACHE_FOUND ccache)

if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif()

add_executable(ozo_benchmark ozo_benchmark.cpp)
target_link_libraries(ozo_benchmark ozo)

Expand Down
7 changes: 0 additions & 7 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
find_program(CCACHE_FOUND ccache)

if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif()

add_executable(ozo_request request.cpp)
target_link_libraries(ozo_request ozo)

Expand Down
4 changes: 4 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ build() {
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}
cmake \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like to conform to current behaviour there should be check for the ccache existence. And it would be nice to allow a user to specify a launcher, e.g. maybe somebody wants to use distcc or something custom.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, this is a reasonable request.

I won't be able to get to this today, but sometime this week, probably.

-DCMAKE_C_COMPILER="${CC_COMPILER}" \
-DCMAKE_CXX_COMPILER="${CXX_COMPILER}" \
-DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS"\
Expand Down Expand Up @@ -148,6 +150,8 @@ build() {
mkdir -p ${EXT_BUILD_DIR}
cd ${EXT_BUILD_DIR}
cmake \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER="${CC_COMPILER}" \
-DCMAKE_CXX_COMPILER="${CXX_COMPILER}" \
-DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
Expand Down
7 changes: 0 additions & 7 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
find_program(CCACHE_FOUND ccache)

include(ExternalProject)
ExternalProject_Add(
GoogleTest
Expand Down Expand Up @@ -83,11 +81,6 @@ target_link_libraries(ozo_tests gmock)
target_link_libraries(ozo_tests ozo)
add_test(ozo_tests ozo_tests)

if(CCACHE_FOUND)
set_target_properties(ozo_tests PROPERTIES RULE_LAUNCH_COMPILE ccache)
set_target_properties(ozo_tests PROPERTIES RULE_LAUNCH_LINK ccache)
endif()

# enable useful warnings and errors
target_compile_options(ozo_tests PRIVATE -Wall -Wextra -pedantic -Werror)

Expand Down