|
@@ -34,17 +34,23 @@ rm -f "$exe_file"
|
|
|
|
|
|
EXTRA_ARGS=""
|
|
|
|
|
|
+if [[ -z "${TESTLIB_COMPILER_OPTIMIZATION_OPT}" ]]; then
|
|
|
+ OPTIMIZATION="2"
|
|
|
+else
|
|
|
+ OPTIMIZATION="${TESTLIB_COMPILER_OPTIMIZATION_OPT}"
|
|
|
+fi
|
|
|
+
|
|
|
if [[ "$CPP" == "cl.exe" ]]; then
|
|
|
- echo "Compiling $src_file, running:" "$CPP" "$CPP_STANDARD" "-F268435456" "-EHsc" "-O2" -I"${CPP_INCLUDE_DIR}" -Fe"$exe_file" "$src_file"
|
|
|
- "$CPP" "$CPP_STANDARD" "-F268435456" "-EHsc" "-O2" -I"${CPP_INCLUDE_DIR}" -Fe"$exe_file" "$src_file"
|
|
|
+ echo "Compiling $src_file, running:" "$CPP" "$CPP_STANDARD" "-F268435456" "-EHsc" "-O${OPTIMIZATION}" -I"${CPP_INCLUDE_DIR}" -Fe"$exe_file" "$src_file"
|
|
|
+ "$CPP" "$CPP_STANDARD" "-F268435456" "-EHsc" "-O${OPTIMIZATION}" -I"${CPP_INCLUDE_DIR}" -Fe"$exe_file" "$src_file"
|
|
|
else
|
|
|
"$CPP" --version
|
|
|
dir=$(dirname "$CPP")
|
|
|
if [[ "$dir" == *"/bin" ]] || [[ "$MACHINE" == "Windows" ]]; then
|
|
|
EXTRA_ARGS="${EXTRA_ARGS} -static"
|
|
|
fi
|
|
|
- echo "Compiling $src_file, running:" "$CPP" "$CPP_OPTS" "$CPP_STANDARD" -Wpedantic -Werror -I"${CPP_INCLUDE_DIR}""$EXTRA_ARGS" -o"$exe_file" -O2 "$src_file"
|
|
|
- eval "$CPP" "$CPP_OPTS" "$CPP_STANDARD" -Wpedantic -Werror -I"${CPP_INCLUDE_DIR}""$EXTRA_ARGS" -o"$exe_file" -O2 "$src_file"
|
|
|
+ echo "Compiling $src_file, running:" "$CPP" "$CPP_OPTS" "$CPP_STANDARD" -Wpedantic -Werror -I"${CPP_INCLUDE_DIR}""$EXTRA_ARGS" -o"$exe_file" "-O${OPTIMIZATION}" "$src_file"
|
|
|
+ eval "$CPP" "$CPP_OPTS" "$CPP_STANDARD" -Wpedantic -Werror -I"${CPP_INCLUDE_DIR}""$EXTRA_ARGS" -o"$exe_file" "-O${OPTIMIZATION}" "$src_file"
|
|
|
fi
|
|
|
|
|
|
rm -f ./*.o ./*.obj
|