From 591956471e6f483459123a8014b4aa0b00fb121d Mon Sep 17 00:00:00 2001 From: doylet Date: Mon, 28 Aug 2023 13:35:53 +1000 Subject: [PATCH] build: Compile into build folder --- .gitignore | 1 + main.cpp => asan_example.cpp | 0 build.bat | 8 +++++++- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .gitignore rename main.cpp => asan_example.cpp (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b45a037 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +Build diff --git a/main.cpp b/asan_example.cpp similarity index 100% rename from main.cpp rename to asan_example.cpp diff --git a/build.bat b/build.bat index 8cdd910..d4d0588 100644 --- a/build.bat +++ b/build.bat @@ -1,2 +1,8 @@ @echo off -cl main.cpp -Z7 -fsanitize=address -nologo -link || exit /b 1 +set script_dir_backslash=%~dp0 +set script_dir=%script_dir_backslash:~0,-1% + +if not exist Build mkdir Build +pushd Build +cl %script_dir%\asan_example.cpp -Zi -O2 -fsanitize=address -nologo -link || exit /b 1 +popd