This commit is contained in:
M 2018-02-25 19:12:11 +00:00 committed by GitHub
commit 0d3e877332
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ option(BUILD_EXAMPLES "Build the examples." ON)
option(BUILD_GAMES "Build the example games." ON)
option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (degrades performance)" OFF)
option(ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan) for debugging" OFF)
option(ENABLE_DEBUG_MODE "Enable debug mode for raylib" OFF)
if(CMAKE_VERSION VERSION_LESS "3.1")
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
@ -40,6 +41,10 @@ if (ENABLE_UBSAN)
add_if_flag_works(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
add_if_flag_works(-fsanitize=undefined CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
endif()
if (ENABLE_DEBUG_MODE)
add_if_flag_works(-g CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
add_if_flag_works(-ggdb CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
endif()
add_subdirectory(src release)