cmake: explicitly disable UNITY_BUILD property for SDL3 libraries

This commit is contained in:
Anonymous Maarten 2025-08-01 01:59:15 +02:00
parent 09221820f6
commit 06cafa3040

View file

@ -448,6 +448,7 @@ if(SDL_SHARED)
add_library(SDL3-shared SHARED) add_library(SDL3-shared SHARED)
add_library(SDL3::SDL3-shared ALIAS SDL3-shared) add_library(SDL3::SDL3-shared ALIAS SDL3-shared)
SDL_AddCommonCompilerFlags(SDL3-shared) SDL_AddCommonCompilerFlags(SDL3-shared)
set_property(TARGET SDL3-shared PROPERTY UNITY_BUILD OFF)
if ("c_std_99" IN_LIST CMAKE_C_COMPILE_FEATURES) if ("c_std_99" IN_LIST CMAKE_C_COMPILE_FEATURES)
target_compile_features(SDL3-shared PRIVATE c_std_99) target_compile_features(SDL3-shared PRIVATE c_std_99)
else() else()
@ -459,6 +460,7 @@ if(SDL_STATIC)
add_library(SDL3-static STATIC) add_library(SDL3-static STATIC)
add_library(SDL3::SDL3-static ALIAS SDL3-static) add_library(SDL3::SDL3-static ALIAS SDL3-static)
SDL_AddCommonCompilerFlags(SDL3-static) SDL_AddCommonCompilerFlags(SDL3-static)
set_property(TARGET SDL3-static PROPERTY UNITY_BUILD OFF)
if ("c_std_99" IN_LIST CMAKE_C_COMPILE_FEATURES) if ("c_std_99" IN_LIST CMAKE_C_COMPILE_FEATURES)
target_compile_features(SDL3-static PRIVATE c_std_99) target_compile_features(SDL3-static PRIVATE c_std_99)
else() else()
@ -1228,6 +1230,7 @@ target_include_directories(SDL_uclibc PRIVATE "${SDL3_SOURCE_DIR}/src")
target_include_directories(SDL_uclibc PRIVATE "${SDL3_SOURCE_DIR}/include") target_include_directories(SDL_uclibc PRIVATE "${SDL3_SOURCE_DIR}/include")
SDL_AddCommonCompilerFlags(SDL_uclibc) SDL_AddCommonCompilerFlags(SDL_uclibc)
sdl_sources(STATIC "$<TARGET_OBJECTS:SDL_uclibc>") sdl_sources(STATIC "$<TARGET_OBJECTS:SDL_uclibc>")
set_property(TARGET SDL_uclibc PROPERTY UNITY_BUILD OFF)
if(TARGET SDL3-shared) if(TARGET SDL3-shared)
target_link_libraries(SDL3-shared PRIVATE SDL_uclibc) target_link_libraries(SDL3-shared PRIVATE SDL_uclibc)
endif() endif()