2019-02-20 13:22:21 +00:00
|
|
|
@echo OFF
|
|
|
|
|
2021-08-08 22:57:53 +00:00
|
|
|
set code_dir=%~dp0
|
2021-08-08 23:03:15 +00:00
|
|
|
if not exist Build mkdir Build
|
|
|
|
pushd Build
|
2019-02-20 13:22:21 +00:00
|
|
|
|
2021-08-09 02:50:46 +00:00
|
|
|
REM Flags
|
|
|
|
REM ------------------------------------------------------------------------
|
2021-08-08 22:57:53 +00:00
|
|
|
REM MT Static CRT
|
|
|
|
REM EHa- Disable exception handling
|
|
|
|
REM GR- Disable C RTTI
|
|
|
|
REM O2 Optimisation Level 2
|
|
|
|
REM Oi Use CPU Intrinsics
|
|
|
|
REM Z7 Combine multi-debug files to one debug file
|
|
|
|
REM wd4201 Nonstandard extension used: nameless struct/union
|
|
|
|
REM Tp Treat header file as CPP source file
|
2022-06-28 14:08:35 +00:00
|
|
|
set compile_flags=-MT -EHa -GR- -Od -Oi -Z7 -wd4201 -D DQN_TEST_WITH_MAIN -nologo
|
2022-06-27 13:39:24 +00:00
|
|
|
set linker_flags=-link -nologo
|
2022-10-12 08:17:51 +00:00
|
|
|
set msvc_flags=
|
2021-08-09 03:12:06 +00:00
|
|
|
set clang_flags=-fsanitize=address -fsanitize=undefined
|
2021-08-08 22:57:53 +00:00
|
|
|
|
2021-08-09 02:50:46 +00:00
|
|
|
REM Compiler: MSVC cl
|
|
|
|
REM ------------------------------------------------------------------------
|
|
|
|
where /q cl || (
|
|
|
|
echo [ERROR] cl is not found, please put MSVC's cl on the path
|
|
|
|
exit /b 1
|
|
|
|
)
|
2023-03-28 11:56:25 +00:00
|
|
|
cl %compile_flags% %msvc_flags% %code_dir%dqn_unit_tests.cpp /Fe:dqn_unit_tests_msvc %link_flags%
|
2021-08-08 22:57:53 +00:00
|
|
|
|
2021-08-09 02:50:46 +00:00
|
|
|
REM Compiler: clang-cl
|
|
|
|
REM ------------------------------------------------------------------------
|
|
|
|
where /q clang-cl || (
|
|
|
|
echo [WARN] Optional clang compile via clang-cl if it's in the path, please put clang-cl on the path for this feature
|
|
|
|
exit /b 0
|
|
|
|
)
|
2023-03-28 11:56:25 +00:00
|
|
|
clang-cl %compile_flags% %clang_flags% %code_dir%dqn_unit_tests.cpp /Fe:dqn_unit_tests_clang %link_flags%
|
2019-02-20 13:22:21 +00:00
|
|
|
popd
|