Skip to content

Commit

Permalink
chore: add ccache
Browse files Browse the repository at this point in the history
Add ccache support in docker container.

Signed-off-by: Melg Eight <public.melg8@gmail.com>
  • Loading branch information
melg8 committed May 15, 2024
1 parent f3d9d35 commit 2e46d0d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"--dns=8.8.4.4",
"--dns-opt=nameserver 8.8.8.8"
],
"mounts": [{ "source": "/home/user/.conan2", "target": "/home/ubuntu/.conan2", "type": "bind" }],
"mounts": [{ "source": "/home/user/.conan2", "target": "/home/ubuntu/.conan2", "type": "bind" },
{ "source": "/home/user/.cache", "target": "/home/ubuntu/.cache", "type": "bind" }],
"customizations": {
"vscode": {
"extensions": [
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ add_definitions(-Dgsl_CONFIG_TRANSPARENT_NOT_NULL=1)
option(ENABLE_TESTING "Enable the tests" ON)
option(USE_CCACHE "Enable use of ccache" ON)
option(ENABLE_COVERAGE "Enable profiling and coverage report analysis" ON)
option(FULL_COMPILER_CHECKS "Enable full compiler checks" ON)

include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/ccache.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/compiler_flags.cmake")
Expand Down
5 changes: 5 additions & 0 deletions ci/docker/docker_files/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ RUN mkdir -p /etc/network \
&& touch /etc/network/interfaces \
&& echo "dns-nameservers 8.8.8.8" >> /etc/network/interfaces


RUN apt-get -y update \
&& apt-get -y install --no-install-recommends \
ccache

RUN apt-get -y update \
&& apt-get -y install --no-install-recommends \
dnsutils \
Expand Down
6 changes: 5 additions & 1 deletion cmake/compiler_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compiler_flags(-fdiagnostics-color=always)
add_compiler_flags(-fno-rtti)
add_compiler_flags(-fno-exceptions)

add_compiler_flags(-fsanitize=address,undefined)
endif()

if (${FULL_COMPILER_CHECKS})
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compiler_flags(-Werror)
add_compiler_flags(-Wno-c++98-compat)
add_compiler_flags(-Wno-c++98-compat-pedantic)
Expand Down Expand Up @@ -130,3 +133,4 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif()
endif()
endif()
endif()

0 comments on commit 2e46d0d

Please sign in to comment.