run.sh: add env to build as debug

This commit is contained in:
Linus Dierheimer
2022-09-22 23:10:34 +02:00
parent 0115b638de
commit 195675f078
2 changed files with 12 additions and 8 deletions
+2
View File
@@ -70,6 +70,8 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wconversion")
+10 -8
View File
@@ -1,19 +1,21 @@
#!/usr/bin/env sh
# make the script exit if any of the commands fail,
# making fastfetch not run if the build failed.
set -e
mkdir -p build/
cd build/
cmake ..
if [ "$OSTYPE" == "linux-gnu" ]; then
cmake_build_extra_args="-j$(nproc)"
else
cmake_build_extra_args=""
if [ -z "${CMAKE_BUILD_TYPE}" ]; then
CMAKE_BUILD_TYPE=Release
fi
cmake --build . --target fastfetch ${cmake_build_extra_args}
cmake "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" ..
if [ -z "$OSTYPE" ] || [ "$OSTYPE" = "linux-gnu" ]; then
cmake_build_args="-j$(nproc)"
else
cmake_build_args=""
fi
cmake --build . --target fastfetch ${cmake_build_args}
export LSAN_OPTIONS=suppressions=../tests/lsan.supp
./fastfetch "$@"