@@ -160,7 +160,9 @@ cc_flags=()
160
160
cxx_flags=()
161
161
162
162
case " ${OSTYPE:? } " in
163
- cygwin) ;;
163
+ cygwin)
164
+ # Most compiler flags are not applicable to builds on Windows distros.
165
+ ;;
164
166
darwin* )
165
167
cc_flags+=(" ${cc_flags_init[@]} " )
166
168
cxx_flags+=(" ${cxx_flags_init[@]} " -stdlib=libc++)
@@ -175,35 +177,40 @@ linux*)
175
177
;;
176
178
esac
177
179
178
- # Sanitizers overwrite the usual compiler flags.
179
- if [[ " ${USE_SANITIZER_ASAN:- } " == " ON" ]]; then
180
- cxx_flags=(
181
- " ${cxx_flags_init[@]} "
182
- -D_GLIBCXX_USE_CXX11_ABI=0
183
- -fsanitize=address
184
- -O1 -g -fno-omit-frame-pointer
185
- )
186
- fi
187
- if [[ " ${USE_SANITIZER_UBSAN:- } " == " ON" ]]; then
188
- cxx_flags=(
189
- " ${cxx_flags_init[@]} "
190
- -D_GLIBCXX_USE_CXX11_ABI=0
191
- -fsanitize=undefined
192
- -fsanitize-blacklist=" $( pwd) /../etc/ubsan.ignorelist"
193
- -fno-sanitize-recover=undefined
194
- -O1 -g -fno-omit-frame-pointer
195
- )
196
- fi
197
-
198
- # Ignore warnings generated by core::optional in mnmlstc/core.
199
- if [[ " ${OSTYPE:? } " == linux* && " ${HOSTTYPE:? } " == powerpc64le ]]; then
200
- cxx_flags+=(-Wno-error=maybe-uninitialized)
201
- fi
202
-
203
- # Ignore deprecation warnings when building on a release branch.
204
- if [ " $( echo " ${branch_name:? } " | cut -f2 -d' /' ) " != " ${branch_name:? } " ]; then
205
- cc_flags+=(-Wno-deprecated-declarations)
206
- cxx_flags+=(-Wno-deprecated-declarations)
180
+ # Most compiler flags are not applicable to builds on Windows distros.
181
+ if [[ " ${OSTYPE:? } " != cygwin ]]; then
182
+ # Sanitizers overwrite the usual compiler flags.
183
+ if [[ " ${USE_SANITIZER_ASAN:- } " == " ON" ]]; then
184
+ cxx_flags=(
185
+ " ${cxx_flags_init[@]} "
186
+ -D_GLIBCXX_USE_CXX11_ABI=0
187
+ -fsanitize=address
188
+ -O1 -g -fno-omit-frame-pointer
189
+ )
190
+ fi
191
+
192
+ # Sanitizers overwrite the usual compiler flags.
193
+ if [[ " ${USE_SANITIZER_UBSAN:- } " == " ON" ]]; then
194
+ cxx_flags=(
195
+ " ${cxx_flags_init[@]} "
196
+ -D_GLIBCXX_USE_CXX11_ABI=0
197
+ -fsanitize=undefined
198
+ -fsanitize-blacklist=" $( pwd) /../etc/ubsan.ignorelist"
199
+ -fno-sanitize-recover=undefined
200
+ -O1 -g -fno-omit-frame-pointer
201
+ )
202
+ fi
203
+
204
+ # Ignore warnings generated by core::optional in mnmlstc/core.
205
+ if [[ " ${OSTYPE:? } " != linux* && " ${HOSTTYPE:? } " == powerpc64le ]]; then
206
+ cxx_flags+=(-Wno-error=maybe-uninitialized)
207
+ fi
208
+
209
+ # Ignore deprecation warnings when building on a release branch.
210
+ if [[ " $( echo " ${branch_name:? } " | cut -f2 -d' /' ) " != " ${branch_name:? } " ]]; then
211
+ cc_flags+=(-Wno-deprecated-declarations)
212
+ cxx_flags+=(-Wno-deprecated-declarations)
213
+ fi
207
214
fi
208
215
209
216
if [[ " ${# cc_flags[@]} " -gt 0 ]]; then
0 commit comments