File tree Expand file tree Collapse file tree 4 files changed +45
-13
lines changed Expand file tree Collapse file tree 4 files changed +45
-13
lines changed Original file line number Diff line number Diff line change 56
56
fi
57
57
58
58
# Use ccache if available.
59
- if command -V ccache; then
60
- export CMAKE_C_COMPILER_LAUNCHER CMAKE_CXX_COMPILER_LAUNCHER
61
- CMAKE_C_COMPILER_LAUNCHER=" ccache"
62
- CMAKE_CXX_COMPILER_LAUNCHER=" ccache"
59
+ if command -V ccache 2> /dev/null; then
60
+ export CMAKE_C_COMPILER_LAUNCHER=ccache
61
+ export CMAKE_CXX_COMPILER_LAUNCHER=ccache
62
+
63
+ # Allow reuse of ccache compilation results between different build directories.
64
+ export CCACHE_BASEDIR CCACHE_NOHASHDIR
65
+ CCACHE_BASEDIR=" $( pwd) /mongo-cxx-driver"
66
+ CCACHE_NOHASHDIR=1
63
67
fi
64
68
65
69
# Install prefix to use for ABI compatibility scripts.
Original file line number Diff line number Diff line change @@ -67,10 +67,18 @@ CMAKE_BUILD_PARALLEL_LEVEL="$(nproc)"
67
67
export CMAKE_BUILD_PARALLEL_LEVEL
68
68
69
69
# Use ccache if available.
70
- if command -v ccache > /dev/null; then
71
- echo " Enabling ccache as CMake compiler launcher"
72
- export CMAKE_C_COMPILER_LAUNCHER=ccache
70
+ if command -V ccache 2> /dev/null; then
73
71
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
72
+
73
+
74
+ # Allow reuse of ccache compilation results between different build directories.
75
+ export CCACHE_BASEDIR CCACHE_NOHASHDIR
76
+ CCACHE_BASEDIR=" $( pwd) "
77
+ CCACHE_NOHASHDIR=1
78
+ # Allow reuse of ccache compilation results between different build directories.
79
+ export CCACHE_BASEDIR CCACHE_NOHASHDIR
80
+ CCACHE_BASEDIR=" $( pwd) "
81
+ CCACHE_NOHASHDIR=1
74
82
fi
75
83
76
84
cmake_build_opts=()
Original file line number Diff line number Diff line change @@ -83,7 +83,6 @@ if [[ "${OSTYPE}" == darwin* ]]; then
83
83
}
84
84
fi
85
85
86
-
87
86
# Default CMake generator to use if not already provided.
88
87
declare CMAKE_GENERATOR CMAKE_GENERATOR_PLATFORM
89
88
if [[ " ${OSTYPE:? } " == " cygwin" ]]; then
@@ -131,6 +130,17 @@ else
131
130
configure_flags+=(" -DENABLE_EXTRA_ALIGNMENT=OFF" )
132
131
fi
133
132
133
+ # Use ccache if available.
134
+ if command -V ccache 2> /dev/null; then
135
+ export CMAKE_C_COMPILER_LAUNCHER=ccache
136
+ export CMAKE_CXX_COMPILER_LAUNCHER=ccache
137
+
138
+ # Allow reuse of ccache compilation results between different build directories.
139
+ export CCACHE_BASEDIR CCACHE_NOHASHDIR
140
+ CCACHE_BASEDIR=" ${mongoc_idir} "
141
+ CCACHE_NOHASHDIR=1
142
+ fi
143
+
134
144
# Install libmongoc.
135
145
{
136
146
echo " Installing C Driver into ${mongoc_dir} ..." 1>&2
Original file line number Diff line number Diff line change @@ -962,11 +962,21 @@ tasks:
962
962
rsync -aq --exclude='examples/add_subdirectory' $(readlink -f ../..) .
963
963
[ -d build ] || mkdir build
964
964
. ./mongo-c-driver/.evergreen/scripts/find-cmake-latest.sh
965
- export CMAKE
966
- CMAKE="$(find_cmake_latest)"
967
- command -v "$CMAKE"
968
- $CMAKE -S . -B build -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF
969
- $CMAKE --build build
965
+ export cmake_binary
966
+ cmake_binary="$(find_cmake_latest)"
967
+ # Use ccache if available.
968
+ if command -V ccache 2>/dev/null; then
969
+ export CMAKE_C_COMPILER_LAUNCHER=ccache
970
+ export CMAKE_CXX_COMPILER_LAUNCHER=ccache
971
+
972
+ # Allow reuse of ccache compilation results between different build directories.
973
+ export CCACHE_BASEDIR CCACHE_NOHASHDIR
974
+ CCACHE_BASEDIR="$(pwd)"
975
+ CCACHE_NOHASHDIR=1
976
+ fi
977
+ command -v "$cmake_binary"
978
+ "$cmake_binary" -S . -B build -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF
979
+ "$cmake_binary" --build build
970
980
./build/hello_mongocxx
971
981
972
982
- name : debian-package-build
You can’t perform that action at this time.
0 commit comments