cmake: use compatible interface properties to disallow linking to a different version of SDL
This commit is contained in:
1 parent
987b748067
commit
103fbcfc05
3 files changed
+20
-4
No files matched your search
@@ -72,6 +72,8 @@ if(EXISTS "${_sdl3_library}" AND EXISTS "${_sdl3_dll_library}")
|
||||
IMPORTED_LOCATION "${_sdl3_dll_library}"
|
||||
COMPATIBLE_INTERFACE_BOOL "SDL3_SHARED"
|
||||
INTERFACE_SDL3_SHARED "ON"
|
||||
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
|
||||
INTERFACE_SDL_VERSION "SDL3"
|
||||
)
|
||||
endif()
|
||||
set(SDL3_SDL3-shared_FOUND TRUE)
|
||||
@@ -91,6 +93,8 @@ if(EXISTS "${_sdl3test_library}")
|
||||
PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES "SDL3::Headers"
|
||||
IMPORTED_LOCATION "${_sdl3test_library}"
|
||||
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
|
||||
INTERFACE_SDL_VERSION "SDL3"
|
||||
)
|
||||
endif()
|
||||
set(SDL3_SDL3_test_FOUND TRUE)
|
||||
|
||||
Reference in new issue
Block a user