diff --git a/CMakeLists.txt b/CMakeLists.txt index eec3f0d012..d107105473 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -456,6 +456,7 @@ if(SDL_SHARED) add_library(SDL3-shared SHARED) add_library(SDL3::SDL3-shared ALIAS SDL3-shared) SDL_AddCommonCompilerFlags(SDL3-shared) + target_compile_definitions(SDL3-shared PRIVATE "$<$:DEBUG>") set_property(TARGET SDL3-shared PROPERTY UNITY_BUILD OFF) if ("c_std_99" IN_LIST CMAKE_C_COMPILE_FEATURES) target_compile_features(SDL3-shared PRIVATE c_std_99) @@ -468,6 +469,7 @@ if(SDL_STATIC) add_library(SDL3-static STATIC) add_library(SDL3::SDL3-static ALIAS SDL3-static) SDL_AddCommonCompilerFlags(SDL3-static) + target_compile_definitions(SDL3-static PRIVATE "$<$:DEBUG>") set_property(TARGET SDL3-static PROPERTY UNITY_BUILD OFF) if ("c_std_99" IN_LIST CMAKE_C_COMPILE_FEATURES) target_compile_features(SDL3-static PRIVATE c_std_99) @@ -480,6 +482,7 @@ if(SDL_TEST_LIBRARY) add_library(SDL3_test STATIC) add_library(SDL3::SDL3_test ALIAS SDL3_test) SDL_AddCommonCompilerFlags(SDL3_test) + target_compile_definitions(SDL3_test PRIVATE "$<$:DEBUG>") endif() # Make sure SDL3::SDL3 always exists @@ -1263,6 +1266,7 @@ target_include_directories(SDL_uclibc PRIVATE "${SDL3_BINARY_DIR}/include-config target_include_directories(SDL_uclibc PRIVATE "${SDL3_SOURCE_DIR}/src") target_include_directories(SDL_uclibc PRIVATE "${SDL3_SOURCE_DIR}/include") SDL_AddCommonCompilerFlags(SDL_uclibc) +target_compile_definitions(SDL_uclibc PRIVATE "$<$:DEBUG>") sdl_sources(STATIC "$") set_property(TARGET SDL_uclibc PROPERTY UNITY_BUILD OFF) if(TARGET SDL3-shared)