mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-11 18:41:14 +00:00
use find_package over manual configuration
This commit is contained in:
parent
fc2fee33ab
commit
434afbe084
@ -75,15 +75,8 @@ if (DOWNLOAD_DEPENDENCIES)
|
||||
include(FetchContent)
|
||||
|
||||
if(ANDROID)
|
||||
set(SDL3_SOURCE_DIR "${CMAKE_SOURCE_DIR}/android-project/build/_deps/sdl3-src")
|
||||
|
||||
add_library(SDL3 SHARED IMPORTED)
|
||||
set_target_properties(SDL3 PROPERTIES
|
||||
IMPORTED_LOCATION "${SDL3_SOURCE_DIR}/build-android/${CMAKE_ANDROID_ARCH_ABI}-build/libSDL3.so"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${SDL3_SOURCE_DIR}/include"
|
||||
)
|
||||
add_library(SDL3::SDL3 ALIAS SDL3)
|
||||
add_library(SDL3::Headers ALIAS SDL3)
|
||||
# Built by Gradle
|
||||
find_package(SDL3 REQUIRED CONFIG COMPONENTS Shared)
|
||||
else()
|
||||
if (WINDOWS_STORE)
|
||||
FetchContent_Declare(
|
||||
|
||||
@ -66,7 +66,7 @@ afterEvaluate {
|
||||
}
|
||||
}
|
||||
|
||||
def aarDest = file("${projectDir}/libs/SDL3.aar")
|
||||
def aarDest = project.providers.provider { file("${projectDir}/libs/SDL3.aar") }
|
||||
tasks.register('downloadSDL3', Exec) {
|
||||
workingDir = androidProject
|
||||
commandLine 'cmake', '-P', 'downloadSDL3.cmake'
|
||||
@ -85,14 +85,14 @@ tasks.register('compileSDL3AndroidArchive', Exec) {
|
||||
def aarFile = file("${androidProject}/${sdl3Dir}/build-android").listFiles().find {
|
||||
it.name.endsWith(".aar")
|
||||
}
|
||||
aarDest.parentFile.mkdirs()
|
||||
aarFile.renameTo(aarDest)
|
||||
aarDest.get().parentFile.mkdirs()
|
||||
aarFile.renameTo(aarDest.get())
|
||||
}
|
||||
}
|
||||
tasks.register('ensureSDL3') {
|
||||
// if DOWNLOAD_DEPENDENCIES=OFF download the version appropriate
|
||||
// 'devel android zip' and place the .aar at `aarDest`
|
||||
if (aarDest.exists()) { return false }
|
||||
if (aarDest.get().exists()) { return false }
|
||||
dependsOn(compileSDL3AndroidArchive)
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user