CMakeLists: Make SDL2 compilation conditional
* vcpkg fails to compile SDL2 on MinGW, so better fetch the package from the environment first
This commit is contained in:
@ -208,8 +208,12 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
if (ENABLE_SDL2)
|
||||
vcpkg_add_package(sdl2)
|
||||
find_package(SDL2 CONFIG REQUIRED)
|
||||
find_package(SDL2 CONFIG)
|
||||
|
||||
if (NOT SDL2_FOUND)
|
||||
vcpkg_add_package(sdl2)
|
||||
find_package(SDL2 CONFIG REQUIRED)
|
||||
endif()
|
||||
|
||||
if (SDL2_FOUND)
|
||||
add_library(SDL2 INTERFACE)
|
||||
|
Reference in New Issue
Block a user