From bec34592a63cc88e4d9aa1db3e0a1b8d26e2ccf0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 19 Dec 2024 11:35:52 -0500 Subject: [PATCH] ci: Enable assertions in CMake build job on Windows Since commit 5b564c371e (gitlab-ci: add Windows infrastructure, 2020-05-20, v3.18.0-rc1~102^2~1) we build with the `Release` configuration on Windows to avoid the `-Zi` flag. However, that also compiles with `-DNDEBUG` by default, thus suppressing assertions. Since the build is meant for testing, enable assertions again. --- .gitlab/ci/configure_windows_vs2022_x64_ninja.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake b/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake index f31c1b568e..3fb894cca7 100644 --- a/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake +++ b/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake @@ -14,6 +14,10 @@ set(CMake_TEST_TLS_VERIFY_URL_BAD "https://badtls-expired.kitware.com" CACHE STR set(CMake_TEST_TLS_VERSION "1.2" CACHE STRING "") set(CMake_TEST_TLS_VERSION_URL_BAD "https://badtls-v1-1.kitware.com:8011" CACHE STRING "") +# Release flags without -DNDEBUG so we get assertions. +set(CMAKE_C_FLAGS_RELEASE "-O2 -Ob2" CACHE STRING "") +set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Ob2" CACHE STRING "") + include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_msvc_cxx_modules_common.cmake") include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_wix_common.cmake") include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_vs_common_ninja.cmake")