summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2024-02-19 18:26:52 +0100
committerSander Vrijders <sander@ouroboros.rocks>2024-02-23 08:10:58 +0100
commitdcefa07624926da23a559eedc3f7361ac36e8312 (patch)
tree6ceddff505baedec78d49660a23eb3499d6d8abb
parentc58cc09cf50a18058efb59e1b4fb73ab1e3a45a2 (diff)
downloadouroboros-dcefa07624926da23a559eedc3f7361ac36e8312.tar.gz
ouroboros-dcefa07624926da23a559eedc3f7361ac36e8312.zip
build: Fix build and tests on appveyor
The configuration parameter was not correctly passed, which caused the build system to build with debug symbols (configuration does not match "Release" and not set CONFIG_OUROBOROS_DEBUG, causing the compiler to include the debugging code. Fixed appveyor command. The build will now fail on an unknown CMAKE_BUILD_TYPE. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
-rw-r--r--CMakeLists.txt13
-rw-r--r--appveyor.yml4
2 files changed, 12 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7bed8396..8bc79b05 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -93,21 +93,28 @@ test_and_set_c_compiler_flag_global(-Wunreachable-code)
test_and_set_c_compiler_flag_global(-Wdeclaration-after-statement)
test_and_set_c_compiler_flag_global(-Winfinite-recursion)
test_and_set_c_compiler_flag_global(-fmax-errors=5)
+
if (CMAKE_BUILD_TYPE STREQUAL "Release")
test_and_set_c_compiler_flag_global(-O3)
-else ()
+elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
+ test_and_set_c_compiler_flag_global(-g)
+elseif (CMAKE_BUILD_TYPE STREQUAL "DebugASan")
test_and_set_c_compiler_flag_global(-g)
-endif ()
-if (CMAKE_BUILD_TYPE STREQUAL "DebugASan")
test_and_set_c_compiler_flag_global(-fsanitize=address)
elseif (CMAKE_BUILD_TYPE STREQUAL "DebugTSan")
+ test_and_set_c_compiler_flag_global(-g)
test_and_set_c_compiler_flag_global(-fsanitize=thread)
elseif (CMAKE_BUILD_TYPE STREQUAL "DebugLSan")
+ test_and_set_c_compiler_flag_global(-g)
test_and_set_c_compiler_flag_global(-fsanitize=leak)
elseif (CMAKE_BUILD_TYPE STREQUAL "DebugUSan")
+ test_and_set_c_compiler_flag_global(-g)
test_and_set_c_compiler_flag_global(-fsanitize=undefined)
elseif (CMAKE_BUILD_TYPE STREQUAL "DebugAnalyzer")
+ test_and_set_c_compiler_flag_global(-g)
test_and_set_c_compiler_flag_global(-fanalyzer)
+else ()
+ message(FATAL_ERROR "Unkown build type ${CMAKE_BUILD_TYPE}")
endif ()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ouroboros-dev.pc.in"
diff --git a/appveyor.yml b/appveyor.yml
index 7fd11335..bf1d8076 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -25,10 +25,10 @@ install:
before_build:
- mkdir -p build
- cd build
- - cmake -DCMAKE_BUILD_TYPE=%CONFIGURATION% ..
+ - cmake -DCMAKE_BUILD_TYPE=$CONFIGURATION ..
build_script:
- make
test_script:
- - make check
+ - env CTEST_OUTPUT_ON_FAILURE=1 make check