@@ -69,7 +69,6 @@ export CMAKE_BUILD_PARALLEL_LEVEL
69
69
if command -V ccache 2> /dev/null; then
70
70
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
71
71
72
-
73
72
# Allow reuse of ccache compilation results between different build directories.
74
73
export CCACHE_BASEDIR CCACHE_NOHASHDIR
75
74
CCACHE_BASEDIR=" $( pwd) "
99
98
: " ${cmake_examples_target:? } "
100
99
101
100
# Create a VERSION_CURRENT file in the build directory to include in the dist tarball.
102
- python ./etc/calc_release_version.py > ./build/VERSION_CURRENT
101
+ python ./etc/calc_release_version.py > ./build/VERSION_CURRENT
103
102
cd build
104
103
105
104
cmake_flags=(
@@ -116,7 +115,7 @@ case "${OSTYPE:?}" in
116
115
cygwin)
117
116
case " ${generator:- } " in
118
117
* 2015* ) cmake_flags+=(" -DBOOST_ROOT=C:/local/boost_1_60_0" ) ;;
119
- * 2017* | * 2019* ) cmake_flags+=(" -DCMAKE_CXX_STANDARD=17" ) ;;
118
+ * 2017* | * 2019* ) cmake_flags+=(" -DCMAKE_CXX_STANDARD=17" ) ;;
120
119
* )
121
120
echo " missing explicit CMake Generator on Windows distro" 1>&2
122
121
exit 1
@@ -147,7 +146,9 @@ cc_flags=()
147
146
cxx_flags=()
148
147
149
148
case " ${OSTYPE:? } " in
150
- cygwin) ;;
149
+ cygwin)
150
+ # Most compiler flags are not applicable to builds on Windows distros.
151
+ ;;
151
152
darwin* )
152
153
cc_flags+=(" ${cc_flags_init[@]} " )
153
154
cxx_flags+=(" ${cxx_flags_init[@]} " -stdlib=libc++)
@@ -162,35 +163,40 @@ linux*)
162
163
;;
163
164
esac
164
165
165
- # Sanitizers overwrite the usual compiler flags.
166
- if [[ " ${USE_SANITIZER_ASAN:- } " == " ON" ]]; then
167
- cxx_flags=(
168
- " ${cxx_flags_init[@]} "
169
- -D_GLIBCXX_USE_CXX11_ABI=0
170
- -fsanitize=address
171
- -O1 -g -fno-omit-frame-pointer
172
- )
173
- fi
174
- if [[ " ${USE_SANITIZER_UBSAN:- } " == " ON" ]]; then
175
- cxx_flags=(
176
- " ${cxx_flags_init[@]} "
177
- -D_GLIBCXX_USE_CXX11_ABI=0
178
- -fsanitize=undefined
179
- -fsanitize-blacklist=" $( pwd) /../etc/ubsan.ignorelist"
180
- -fno-sanitize-recover=undefined
181
- -O1 -g -fno-omit-frame-pointer
182
- )
183
- fi
184
-
185
- # Ignore warnings generated by core::optional in mnmlstc/core.
186
- if [[ " ${OSTYPE:? } " == linux* && " ${HOSTTYPE:? } " == powerpc64le ]]; then
187
- cxx_flags+=(-Wno-error=maybe-uninitialized)
188
- fi
189
-
190
- # Ignore deprecation warnings when building on a release branch.
191
- if [ " $( echo " ${branch_name:? } " | cut -f2 -d' /' ) " != " ${branch_name:? } " ]; then
192
- cc_flags+=(-Wno-deprecated-declarations)
193
- cxx_flags+=(-Wno-deprecated-declarations)
166
+ # Most compiler flags are not applicable to builds on Windows distros.
167
+ if [[ " ${OSTYPE:? } " != cygwin ]]; then
168
+ # Sanitizers overwrite the usual compiler flags.
169
+ if [[ " ${USE_SANITIZER_ASAN:- } " == " ON" ]]; then
170
+ cxx_flags=(
171
+ " ${cxx_flags_init[@]} "
172
+ -D_GLIBCXX_USE_CXX11_ABI=0
173
+ -fsanitize=address
174
+ -O1 -g -fno-omit-frame-pointer
175
+ )
176
+ fi
177
+
178
+ # Sanitizers overwrite the usual compiler flags.
179
+ if [[ " ${USE_SANITIZER_UBSAN:- } " == " ON" ]]; then
180
+ cxx_flags=(
181
+ " ${cxx_flags_init[@]} "
182
+ -D_GLIBCXX_USE_CXX11_ABI=0
183
+ -fsanitize=undefined
184
+ -fsanitize-blacklist=" $( pwd) /../etc/ubsan.ignorelist"
185
+ -fno-sanitize-recover=undefined
186
+ -O1 -g -fno-omit-frame-pointer
187
+ )
188
+ fi
189
+
190
+ # Ignore warnings generated by core::optional in mnmlstc/core.
191
+ if [[ " ${OSTYPE:? } " == linux* && " ${HOSTTYPE:? } " == powerpc64le ]]; then
192
+ cxx_flags+=(-Wno-error=maybe-uninitialized)
193
+ fi
194
+
195
+ # Ignore deprecation warnings when building on a release branch.
196
+ if [[ " $( echo " ${branch_name:? } " | cut -f2 -d' /' ) " != " ${branch_name:? } " ]]; then
197
+ cc_flags+=(-Wno-deprecated-declarations)
198
+ cxx_flags+=(-Wno-deprecated-declarations)
199
+ fi
194
200
fi
195
201
196
202
if [[ " ${# cc_flags[@]} " -gt 0 ]]; then
0 commit comments