From 66968836bcc68cfa57fc560aac9a8596839dff77 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Thu, 21 Dec 2023 06:05:18 +0100 Subject: [PATCH] yet another attempt to unfuck build and make sure assertions are enabled properly --- CMakeLists.txt | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e38dbd7..28b2b8b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,9 @@ OPTION(AQUARIA_USE_GLM "Use GLM for matrix math" TRUE) OPTION(AQUARIA_DEBUG_SHOW_PATHS "Show important paths upon game start to aid in finding path problems" FALSE) mark_as_advanced(AQUARIA_DEBUG_SHOW_PATHS) +#add_compile_options(-fsanitize=address) +#add_link_options(-fsanitize=address) + ################ Look for external libraries ### Pick one: SDL 1.2 or SDL2 @@ -138,14 +141,17 @@ ELSE(AQUARIA_DEMO_BUILD) ADD_DEFINITIONS(-DAQUARIA_BUILD_SCENEEDITOR=1) ENDIF(AQUARIA_DEMO_BUILD) -IF(CMAKE_BUILD_TYPE STREQUAL "Release") - ADD_DEFINITIONS(-DNDEBUG) # MSVC defines this in release mode by default, gcc/mingw do not - message(STATUS "This is a release build.") -ENDIF(CMAKE_BUILD_TYPE STREQUAL "Release") -IF(CMAKE_BUILD_TYPE STREQUAL "Debug") - ADD_DEFINITIONS(-D_DEBUG) # MSVC defines this in debug mode by default, gcc/mingw do not - message(STATUS "This is a debug build.") -ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug") +IF(NOT MSVC) + # MSVC defines these in release mode by default, gcc/mingw do not + IF(CMAKE_BUILD_TYPE STREQUAL "Release") + ADD_DEFINITIONS(-DNDEBUG) + message(STATUS "This is a release build.") + ENDIF(CMAKE_BUILD_TYPE STREQUAL "Release") + IF(CMAKE_BUILD_TYPE STREQUAL "Debug") + ADD_DEFINITIONS(-D_DEBUG) + message(STATUS "This is a debug build.") + ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug") +ENDIF(NOT MSVC) # FIXME: These should go IF(UNIX)