Skip to content

Commit d95df9a

Browse files
committed
Auto merge of #26004 - alexcrichton:msvc-llvm-assertions, r=brson
If LLVM assertions are enabled for MSVC, it looks like the output directory is still just `Release` (or assertions are just always ignored on MSVC).
2 parents da0d452 + 3d74fbd commit d95df9a

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

configure

+15-10
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,12 @@ CFG_LLVM_SRC_DIR=${CFG_SRC_DIR}src/llvm/
13071307
for t in $CFG_HOST
13081308
do
13091309
do_reconfigure=1
1310+
is_msvc=0
1311+
case "$t" in
1312+
(*-msvc)
1313+
is_msvc=1
1314+
;;
1315+
esac
13101316

13111317
if [ -z $CFG_LLVM_ROOT ]
13121318
then
@@ -1326,7 +1332,13 @@ do
13261332
LLVM_ASSERTION_OPTS="--disable-assertions"
13271333
else
13281334
LLVM_ASSERTION_OPTS="--enable-assertions"
1329-
LLVM_INST_DIR=${LLVM_INST_DIR}+Asserts
1335+
1336+
# Apparently even if we request assertions be enabled for MSVC,
1337+
# LLVM's CMake build system ignore this and outputs in `Release`
1338+
# anyway.
1339+
if [ ${is_msvc} -eq 0 ]; then
1340+
LLVM_INST_DIR=${LLVM_INST_DIR}+Asserts
1341+
fi
13301342
fi
13311343
else
13321344
msg "not reconfiguring LLVM, external LLVM root"
@@ -1356,14 +1368,7 @@ do
13561368
done
13571369
fi
13581370

1359-
use_cmake=0
1360-
case "$t" in
1361-
(*-msvc)
1362-
use_cmake=1
1363-
;;
1364-
esac
1365-
1366-
if [ ${do_reconfigure} -ne 0 ] && [ ${use_cmake} -ne 0 ]
1371+
if [ ${do_reconfigure} -ne 0 ] && [ ${is_msvc} -ne 0 ]
13671372
then
13681373
msg "configuring LLVM for $t with cmake"
13691374

@@ -1388,7 +1393,7 @@ do
13881393
need_ok "LLVM cmake configure failed"
13891394
fi
13901395

1391-
if [ ${do_reconfigure} -ne 0 ] && [ ${use_cmake} -eq 0 ]
1396+
if [ ${do_reconfigure} -ne 0 ] && [ ${is_msvc} -eq 0 ]
13921397
then
13931398
# LLVM's configure doesn't recognize the new Windows triples yet
13941399
gnu_t=$(to_gnu_triple $t)

0 commit comments

Comments
 (0)