get building

This commit is contained in:
Kylie C 2025-08-04 00:53:04 -04:00
parent 658903d8b6
commit 64b44bf245
9 changed files with 42 additions and 34 deletions

2
.gitignore vendored
View File

@ -6,12 +6,14 @@ Release/
/.idea
.env
.venv
.gradle
env/
venv/
ENV/
VENV/
env.bak/
venv.bak/
local.properties
/build/
/build_debug/
/legobin/

View File

@ -73,22 +73,27 @@ if (DOWNLOAD_DEPENDENCIES)
# FetchContent downloads and configures dependencies
message(STATUS "Fetching SDL3 and iniparser. This might take a while...")
include(FetchContent)
if (WINDOWS_STORE)
FetchContent_Declare(
SDL3
GIT_REPOSITORY "https://github.com/Helloyunho/SDL3-uwp.git"
GIT_TAG "main"
EXCLUDE_FROM_ALL
)
else()
FetchContent_Declare(
# FIXME: properly build and source the .aar
if (NOT ANDROID)
if (WINDOWS_STORE)
FetchContent_Declare(
SDL3
GIT_REPOSITORY "https://github.com/libsdl-org/SDL.git"
GIT_REPOSITORY "https://github.com/Helloyunho/SDL3-uwp.git"
GIT_TAG "main"
EXCLUDE_FROM_ALL
)
)
else()
FetchContent_Declare(
SDL3
GIT_REPOSITORY "https://github.com/libsdl-org/SDL.git"
GIT_TAG "main"
EXCLUDE_FROM_ALL
)
endif()
FetchContent_MakeAvailable(SDL3)
else()
find_package(SDL3 CONFIG REQUIRED)
endif()
FetchContent_MakeAvailable(SDL3)
# if(ANDROID)
# FetchContent_GetProperties(SDL3)
@ -524,8 +529,7 @@ endif()
if (ISLE_BUILD_APP)
if(ANDROID)
# SDL applications need to be built as a shared library
function(add_executable TARGET)
function(add_executable TARGET PLATFORM)
add_library(${TARGET} SHARED ${ARGN})
endfunction()
endif()
@ -609,6 +613,11 @@ if (ISLE_BUILD_APP)
ISLE/ios/config.cpp
)
endif()
if (ANDROID)
target_sources(isle PRIVATE
ISLE/android/config.cpp
)
endif()
if(Python3_FOUND)
if(NOT DEFINED PYTHON_PIL_AVAILABLE)
execute_process(

View File

@ -72,7 +72,7 @@
#include "ios/config.h"
#endif
#ifdef __ANDROID__
#ifdef ANDROID
#include "android/config.h"
#endif
@ -1133,7 +1133,7 @@ bool IsleApp::LoadConfig()
#ifdef IOS
IOS_SetupDefaultConfigOverrides(dict);
#endif
#ifdef __ANDROID__
#ifdef ANDROID
Android_SetupDefaultConfigOverrides(dict);
#endif
iniparser_dump_ini(dict, iniFP);
@ -1236,7 +1236,7 @@ bool IsleApp::LoadConfig()
iniparser_freedict(dict);
delete[] iniConfig;
#ifndef IOS
#if !defined(IOS) && !defined(ANDROID)
SDL_free(prefPath);
#endif

View File

@ -1,3 +1,5 @@
.cxx
.gradle
local.properties
build
*.aar

View File

@ -3,11 +3,11 @@ plugins {
}
android {
namespace "org.legoisland.Isle"
namespace "org.legoisland.isle"
compileSdk 35
defaultConfig {
applicationId 'org.legoisland.lego-island'
applicationId 'org.legoisland.isle'
minSdk 21
targetSdk 35
versionCode 1
@ -15,9 +15,7 @@ android {
externalNativeBuild {
cmake {
arguments '-DANDROID_STL=c++_shared'
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
// abiFilters 'arm64-v8a'
arguments '-DANDROID_STL=c++_shared', '-DCMAKE_BUILD_TYPE=Release', '-DISLE_USE_DX5=false', '-DISLE_BUILD_CONFIG=false', '-DENABLE_CLANG_TIDY=false', '-DISLE_WERROR=true', '-DISLE_DEBUG=false', '-Werror=dev', '-DCMAKE_MESSAGE_LOG_LEVEL=STATUS'
}
}
}

View File

@ -2,8 +2,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<!-- OpenGL ES 2.0 -->
<uses-feature android:glEsVersion="0x00020000" />
<!-- OpenGL ES 3.0 -->
<uses-feature
android:glEsVersion="0x00030000"
android:required="true" />
<!-- Touchscreen support -->
<uses-feature
@ -31,18 +33,13 @@
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:hardwareAccelerated="true"
tools:targetApi="31">
<activity
android:name="org.libsdl.helloworld.HelloWorldActivity"
android:name="org.legoisland.isle.IsleActivity"
android:exported="true"
android:label="@string/app_name"
android:configChanges="layoutDirection|locale|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
android:preferMinimalPostProcessing="true">
<intent-filter>

View File

@ -1,8 +1,8 @@
package org.legoisland.Isle;
package org.legoisland.isle;
import org.libsdl.app.SDLActivity;
public class HelloWorldActivity extends SDLActivity {
public class IsleActivity extends SDLActivity {
protected String[] getLibraries() {
return new String[] { "SDL3", "lego1", "isle" };
}

View File

@ -12,5 +12,5 @@ dependencyResolutionManagement {
mavenCentral()
}
}
rootProject.name = "lego-island"
rootProject.name = "legoisland"
include ':app'

View File

@ -44,7 +44,7 @@ if(NOT WINDOWS_STORE)
message(STATUS "🧩 OpenGL 1.x support not enabled — needs OpenGL")
endif()
find_library(OPENGL_ES3_LIBRARY NAMES GLESv2)
find_library(OPENGL_ES3_LIBRARY NAMES GLESv3 GLESv2)
if(EMSCRIPTEN OR OPENGL_ES3_LIBRARY)
message(STATUS "Found OpenGL: enabling OpenGL ES 3.x renderer")
target_sources(miniwin PRIVATE src/d3drm/backends/opengles3/renderer.cpp)