From d3506737f0a01a5b50af50e80941c98673a47f60 Mon Sep 17 00:00:00 2001 From: Archie Hilton Date: Tue, 14 May 2024 22:01:38 +0100 Subject: [PATCH] Wrap glfwTerminate() in DEBUG symbol This prevents asan from spitting out a lot of unhelpful warnings. --- src/CMakeLists.txt | 1 + src/main.cc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 305171e..9bec234 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,6 +9,7 @@ add_executable(Exponent target_link_libraries(Exponent PUBLIC glfw glm::glm) target_include_directories(Exponent PUBLIC ${CMAKE_SOURCE_DIR}/include) +target_compile_definitions(Exponent PUBLIC "$<$:DEBUG>") target_compile_definitions(Exponent PRIVATE GLFW_INCLUDE_NONE) file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/shaders/shader.frag" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/shaders/") diff --git a/src/main.cc b/src/main.cc index d847eac..69af39d 100644 --- a/src/main.cc +++ b/src/main.cc @@ -175,6 +175,8 @@ int main() { } glfwDestroyWindow(w); +#ifndef DEBUG glfwTerminate(); +#endif exit(EXIT_SUCCESS); }