From 585d79a219f47afbc43317703fbf31ecd2957285 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 17 Mar 2018 23:44:02 -0500 Subject: [PATCH] Make ASAN a distinct build type from Debug --- deps/ox/.gitignore | 1 + deps/ox/Makefile | 6 ++++++ deps/ox/build/Makefile | 7 ++++++- deps/ox/scripts/setup_build | 5 ++++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/deps/ox/.gitignore b/deps/ox/.gitignore index 41c3c78f..3572ba40 100644 --- a/deps/ox/.gitignore +++ b/deps/ox/.gitignore @@ -1,5 +1,6 @@ build/current build/gba +build/*-asan build/*-debug build/*-release tags diff --git a/deps/ox/Makefile b/deps/ox/Makefile index 67218516..a5c54554 100644 --- a/deps/ox/Makefile +++ b/deps/ox/Makefile @@ -49,6 +49,12 @@ debug: ${ENV_RUN} rm -f build/current ${ENV_RUN} ln -s ${HOST_ENV}-debug build/current +asan: + ${ENV_RUN} rm -rf build/${HOST_ENV}-asan + ${ENV_RUN} ./scripts/setup_build ${HOST_ENV} asan + ${ENV_RUN} rm -f build/current + ${ENV_RUN} ln -s ${HOST_ENV}-debug build/current + windows: ${ENV_RUN} rm -rf build/windows ${ENV_RUN} ./scripts/setup_build windows diff --git a/deps/ox/build/Makefile b/deps/ox/build/Makefile index e4a65ed2..c18e1165 100644 --- a/deps/ox/build/Makefile +++ b/deps/ox/build/Makefile @@ -1,4 +1,4 @@ -all: gba_build native_build native_debug_build windows_release windows_debug +all: gba_build native_build native_debug_build native_asan_build windows_release windows_debug gba_build: @if [ -d gba-release ]; then \ @@ -15,6 +15,11 @@ native_debug_build: cmake --build ${HOST_ENV}-debug --target ${ARGS}; \ fi +native_asan_build: + @if [ -d ${HOST_ENV}-asan ]; then \ + cmake --build ${HOST_ENV}-asan --target ${ARGS}; \ + fi + windows_release: @if [ -d windows-release ]; then \ cmake --build windows-release --target ${ARGS}; \ diff --git a/deps/ox/scripts/setup_build b/deps/ox/scripts/setup_build index 0b7f47d8..7034effd 100755 --- a/deps/ox/scripts/setup_build +++ b/deps/ox/scripts/setup_build @@ -13,8 +13,11 @@ elif [[ $TARGET == gba ]]; then toolchain="-DCMAKE_TOOLCHAIN_FILE=cmake/Modules/GBA.cmake -DOX_USE_STDLIB=OFF -DCMAKE_INSTALL_PREFIX=$DEVKITARM" fi -if [[ $BUILD_TYPE == debug ]]; then +if [[ $BUILD_TYPE == asan ]]; then buildTypeArgs="-DUSE_ASAN=ON -DCMAKE_BUILD_TYPE=Debug" + buildDir="build/${TARGET}-asan" +elif [[ $BUILD_TYPE == debug ]]; then + buildTypeArgs="-DCMAKE_BUILD_TYPE=Debug" buildDir="build/${TARGET}-debug" else buildTypeArgs="-DCMAKE_BUILD_TYPE=Release"