Skip to content

Commit 18956c6

Browse files
committed
More attempts to get rid of NDEBUG
1 parent 92da0ce commit 18956c6

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ jobs:
104104
fi
105105
"${cmake_cmd[@]}"
106106
107+
cat CMakeCache.txt
107108
if [[ "${RUNNER_OS}" == "Windows" ]]; then
108109
cmake --build ./ --config RelWithDebInfo --verbose
109110
else

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ endif()
138138
foreach(NDEBUG_FLAG_STR IN ITEMS "/D NDEBUG" "-DNDEBUG")
139139
string(REPLACE "${NDEBUG_FLAG_STR}" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO
140140
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
141+
# TODO: this should not be necessary.
142+
string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " -UNDEBUG")
141143
if(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
142144
string(REPLACE "${NDEBUG_FLAG_STR}" "" CMAKE_CXX_FLAGS
143145
"${CMAKE_CXX_FLAGS}")

examples/cpp/example_search.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,10 @@ int main() {
5454

5555
delete[] data;
5656
delete alg_hnsw;
57+
#ifdef _MSC_VER
58+
// Remove this once we make sure that assertions work correctly in MSVC
59+
// RelWithDebInfo builds.
60+
assert(false);
61+
#endif
5762
return 0;
5863
}

0 commit comments

Comments
 (0)