diff --git a/package/c/hectic/default.nix b/package/c/hectic/default.nix index 6969e41..b11b4e5 100644 --- a/package/c/hectic/default.nix +++ b/package/c/hectic/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation { buildPhase = '' ls - ${bash}/bin/sh ./make.sh build + ${bash}/bin/sh ./make.sh --no-asan build ''; checkPhase = '' diff --git a/package/c/hectic/make.sh b/package/c/hectic/make.sh index 8c17fb9..f2fa89b 100644 --- a/package/c/hectic/make.sh +++ b/package/c/hectic/make.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Usage: make.sh [build|check[test1 test2 ...]] [--norun] [--debug] [--color] +# Usage: make.sh [build|check[test1 test2 ...]] [--norun] [--debug] [--color] [--no-asan] # Options: # build Build the library and app (default if no mode is provided). # watch Build the library and app and watch for changes. @@ -7,6 +7,7 @@ # --norun (check only) Build tests but do not run them. # --debug Build with -O0 (debug mode). # --color Pass -fdiagnostics-color=always to compiler. +# --no-asan Build without Address Sanitizer. # help, --help Show this help message. # test1 test2 (check only) Run specific tests by name (without .c extension) @@ -30,13 +31,14 @@ check_dependencies print_help() { cat < /dev/null +# Apply ASAN settings based on user choice +if [ "$USE_ASAN" -eq 0 ]; then + # Remove ASAN flags + CFLAGS=$(echo "$CFLAGS" | sed 's/-fsanitize=address//') + LDFLAGS=$(echo "$LDFLAGS" | sed 's/-static-libasan//') +fi + if [ -n "$COLOR_FLAG" ]; then CFLAGS="$CFLAGS $COLOR_FLAG" fi