From 576eda442d1e7409422874ee020b77c1d5c4a7ec Mon Sep 17 00:00:00 2001 From: Owen Shepherd Date: Tue, 15 Aug 2023 11:26:36 +0200 Subject: [PATCH] ci: Define CI environment variable inside cmake --- CMakeLists.txt | 4 ++++ src/run_tests.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f640bc0e..75330255 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,10 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) enable_testing() +if (DEFINED CI) + add_definitions(-DBUILD_FOR_CI) +endif() + if (MSVC) # warning level 4 add_compile_options(/W4) diff --git a/src/run_tests.c b/src/run_tests.c index 02f0a211..546948a2 100644 --- a/src/run_tests.c +++ b/src/run_tests.c @@ -33,7 +33,7 @@ static void run_tests(test_state *state) { test_semantics(state); // CI is currently throwing std::bad_allow when // jitting... -#ifndef CI +#ifndef BUILD_FOR_CI test_llvm(state); #endif }