Skip to content

Commit 8f37d19

Browse files
Accept both -Z7 and /Z7
1 parent b2a374c commit 8f37d19

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

env/standard-compiler-env-to-ocaml-configure-env.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,11 @@ if [ -n "${autodetect_compiler_CC:-}" ]; then
198198
autodetect_compiler_CFLAGS=$(printf "%s" " $autodetect_compiler_CFLAGS " | PATH=/usr/bin:/bin sed 's/ -Os / /g')
199199
fi
200200

201-
# -Z7 is an option that should be in CC for OCaml
201+
# /Z7 or normalized -Z7 is an option that should be in CC for OCaml
202202
# Confer: https://learn.microsoft.com/en-us/cpp/build/reference/z7-zi-zi-debug-information-format?view=msvc-170
203-
if printf "%s" " ${autodetect_compiler_CFLAGS:-} " | PATH=/usr/bin:/bin grep -q ' -Z7 '; then
203+
if printf "%s" " ${autodetect_compiler_CFLAGS:-} " | PATH=/usr/bin:/bin grep -q ' [/-]Z7 '; then
204204
autodetect_compiler_CC="$autodetect_compiler_CC -Z7"
205-
autodetect_compiler_CFLAGS=$(printf "%s" " $autodetect_compiler_CFLAGS " | PATH=/usr/bin:/bin sed 's/ -Z7 / /g')
205+
autodetect_compiler_CFLAGS=$(printf "%s" " $autodetect_compiler_CFLAGS " | PATH=/usr/bin:/bin sed 's/ [/-]Z7 / /g')
206206
fi
207207

208208
# -mmacosx-version-min=MM.NN needs to be in CC for OCaml

0 commit comments

Comments
 (0)