fix Termux build
This commit is contained in:
parent
c83e146d11
commit
09106f661f
|
@ -14,8 +14,10 @@ set(CMAKE_PROJECT_VERSION_PATCH 1)
|
|||
|
||||
if (ANDROID)
|
||||
set(BUILD_GUI_DEFAULT OFF)
|
||||
set(SYSTEM_SDL2_DEFAULT ON)
|
||||
else()
|
||||
set(BUILD_GUI_DEFAULT ON)
|
||||
set(SYSTEM_SDL2_DEFAULT OFF)
|
||||
endif()
|
||||
|
||||
find_package(PkgConfig)
|
||||
|
@ -31,7 +33,7 @@ option(WITH_JACK "Whether to build with JACK support. Auto-detects if JACK is av
|
|||
option(SYSTEM_FMT "Use a system-installed version of fmt instead of the vendored one" OFF)
|
||||
option(SYSTEM_LIBSNDFILE "Use a system-installed version of libsndfile instead of the vendored one" OFF)
|
||||
option(SYSTEM_ZLIB "Use a system-installed version of zlib instead of the vendored one" OFF)
|
||||
option(SYSTEM_SDL2 "Use a system-installed version of SDL2 instead of the vendored one" OFF)
|
||||
option(SYSTEM_SDL2 "Use a system-installed version of SDL2 instead of the vendored one" ${SYSTEM_SDL2_DEFAULT})
|
||||
option(WARNINGS_ARE_ERRORS "Whether warnings in furnace's C++ code should be treated as errors" OFF)
|
||||
|
||||
set(DEPENDENCIES_INCLUDE_DIRS "")
|
||||
|
@ -42,6 +44,12 @@ set(DEPENDENCIES_LIBRARY_DIRS "")
|
|||
set(DEPENDENCIES_LINK_OPTIONS "")
|
||||
set(DEPENDENCIES_LEGACY_LDFLAGS "")
|
||||
|
||||
if (BUILD_GUI)
|
||||
set(SYSTEM_SDL_MIN_VER 2.0.18)
|
||||
else()
|
||||
set(SYSTEM_SDL_MIN_VER 2.0.0)
|
||||
endif()
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
list(APPEND DEPENDENCIES_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
|
||||
|
@ -114,7 +122,7 @@ endif()
|
|||
|
||||
if (SYSTEM_SDL2)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(SDL sdl>=2.0.18)
|
||||
pkg_check_modules(SDL sdl>=${SYSTEM_SDL_MIN_VER})
|
||||
if (SDL_FOUND)
|
||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${SDL_INCLUDE_DIRS})
|
||||
list(APPEND DEPENDENCIES_COMPILE_OPTIONS ${SDL_CFLAGS_OTHER})
|
||||
|
@ -125,13 +133,13 @@ if (SYSTEM_SDL2)
|
|||
endif()
|
||||
endif()
|
||||
if (NOT SDL_FOUND)
|
||||
find_package(SDL 2.0.18)
|
||||
find_package(SDL ${SYSTEM_SDL_MIN_VER})
|
||||
if (SDL_FOUND)
|
||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${SDL_INCLUDE_DIR})
|
||||
list(APPEND DEPENDENCIES_LIBRARIES ${SDL_LIBRARY})
|
||||
else()
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(SDL2 sdl2>=2.0.18)
|
||||
pkg_check_modules(SDL2 sdl2>=${SYSTEM_SDL_MIN_VER})
|
||||
if (SDL2_FOUND)
|
||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${SDL2_INCLUDE_DIRS})
|
||||
list(APPEND DEPENDENCIES_COMPILE_OPTIONS ${SDL2_CFLAGS_OTHER})
|
||||
|
@ -142,7 +150,7 @@ if (SYSTEM_SDL2)
|
|||
endif()
|
||||
endif()
|
||||
if (NOT SDL2_FOUND)
|
||||
find_package(SDL2 2.0.18 REQUIRED)
|
||||
find_package(SDL2 ${SYSTEM_SDL_MIN_VER} REQUIRED)
|
||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
|
||||
list(APPEND DEPENDENCIES_LIBRARIES ${SDL2_LIBRARY})
|
||||
endif()
|
||||
|
|
Loading…
Reference in New Issue