This is required for AddressSanitizer builds with clang-cl.
args_orig=$@
args="-nologo -W3"
-md=-MD
+static_crt=
+debug_crt=
cl="cl"
ml="ml"
safeseh="-safeseh"
defines="$defines $1"
shift 1
;;
+ -DUSE_STATIC_RTL)
+ # Link against static CRT.
+ static_crt=1
+ shift 1
+ ;;
-DUSE_DEBUG_RTL)
# Link against debug CRT.
- md=-MDd
+ debug_crt=1
shift 1
;;
-c)
args="$args -link -OPT:REF -OPT:ICF -INCREMENTAL:NO"
fi
+if [ -n "$static_crt" ]; then
+ md=-MT
+else
+ md=-MD
+fi
+
+if [ -n "$debug_crt" ]; then
+ md="${md}d"
+fi
+
if [ -n "$assembly" ]; then
if [ -z "$outdir" ]; then
outdir="."