cmake: make sure SDL2::SDL2 is always available

This commit is contained in:
Anonymous Maarten
2022-06-15 04:29:14 +02:00
committed by Sam Lantinga
parent 69df26a0d4
commit 6d1dfc8322
3 changed files with 23 additions and 5 deletions

View File

@@ -3194,3 +3194,8 @@ endif()
##### Fix Objective C builds #####
set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} ${CMAKE_C_FLAGS}")
# Make sure SDL2::SDL2 always exists
if(TARGET SDL2::SDL2-static AND NOT TARGET SDL2::SDL2)
add_library(SDL2::SDL2 ALIAS SDL2-static)
endif()