diff --git a/.github/workflows/eepp-android-build-check.yml b/.github/workflows/eepp-android-build-check.yml new file mode 100644 index 000000000..48a012739 --- /dev/null +++ b/.github/workflows/eepp-android-build-check.yml @@ -0,0 +1,35 @@ +name: Android + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + - uses: android-actions/setup-android@v3 + - name: Accept licenses + run: yes | sdkmanager --licenses > /dev/null + - name: Install SDK + NDK components + run: | + sdkmanager "platform-tools" \ + "platforms;android-34" \ + "build-tools;34.0.0" \ + "ndk;28.1.13356709" + - name: Configure local properties + run: | + cd make/android-project + { + echo "sdk.dir=$ANDROID_SDK_ROOT" + echo "ndk.dir=$ANDROID_SDK_ROOT/ndk/28.1.13356709" + } > local.properties + - name: Build + run: | + cd make/android-project + ./gradlew assembleEcodeRelease -Pandroid.injected.ndk.abiFilters=arm64-v8a diff --git a/.github/workflows/eepp-ios-build-check.yml b/.github/workflows/eepp-ios-build-check.yml new file mode 100644 index 000000000..14a8fd90b --- /dev/null +++ b/.github/workflows/eepp-ios-build-check.yml @@ -0,0 +1,18 @@ +name: iOS + +on: [push, pull_request] + +jobs: + MacOS: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install dependencies + run: | + brew install cmake premake + - name: Build + run: | + cd project/ios + sh ./compile-all.sh diff --git a/.gitignore b/.gitignore index 8e0f52ce3..5c01e2842 100644 --- a/.gitignore +++ b/.gitignore @@ -75,3 +75,8 @@ ecode.dmg /projects/linux/ecode/polyfill-glibc /bin/crashes/* /bin/config/* +/projects/android-project/.settings/* +/projects/android-project/app/.settings/* +/projects/android-project/app/.classpath +/projects/android-project/.project +/projects/android-project/app/.project diff --git a/README.md b/README.md index f6520aca7..57f9f273e 100644 --- a/README.md +++ b/README.md @@ -575,8 +575,8 @@ click in the plus icon (+), then go to _Add Other..._ and locate and select the This script can be used to build the SDL2 and eepp as two fat static libraries with arm64 and x86_64 architectures in it (arm64 for iPhone/iPad and x86_64 for -the simulators). To generate a release build pass `config=release` as a parameter -for the script (`sh compile-all.sh config=release`). The built files will be +the simulators). To generate a release build pass `config=release_arm64` as a parameter +for the script (`sh compile-all.sh config=release_arm64`). The built files will be located in `libs/ios/`, as `libSDL2.a` and `libeepp.a` (or `libeepp-debug.a` for debug build). This two files can be integrated in your project. diff --git a/projects/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java b/projects/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java index 56f677e66..11d1bf128 100644 --- a/projects/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java +++ b/projects/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java @@ -121,7 +121,7 @@ public class HIDDeviceManager { // If our context is an activity, exit rather than crashing when we can't // call our native functions. Activity activity = (Activity)context; - + activity.finish(); } catch (ClassCastException cce) { @@ -133,7 +133,7 @@ public class HIDDeviceManager { return; } - + HIDDeviceRegisterCallback(); mSharedPreferences = mContext.getSharedPreferences("hidapi", Context.MODE_PRIVATE); @@ -199,7 +199,7 @@ public class HIDDeviceManager { Log.i(TAG," Interface protocol: " + mUsbInterface.getInterfaceProtocol()); Log.i(TAG," Endpoint count: " + mUsbInterface.getEndpointCount()); - // Get endpoint details + // Get endpoint details for (int epi = 0; epi < mUsbInterface.getEndpointCount(); epi++) { UsbEndpoint mEndpoint = mUsbInterface.getEndpoint(epi); @@ -533,7 +533,7 @@ public class HIDDeviceManager { for (HIDDevice device : mDevicesById.values()) { device.setFrozen(frozen); } - } + } } ////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -568,7 +568,11 @@ public class HIDDeviceManager { if (usbDevice != null && !mUsbManager.hasPermission(usbDevice)) { HIDDeviceOpenPending(deviceID); try { - mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, new Intent(HIDDeviceManager.ACTION_USB_PERMISSION), 0)); + int flags = 0; + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) { // Android 12+ + flags |= PendingIntent.FLAG_MUTABLE; + } + mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, new Intent(HIDDeviceManager.ACTION_USB_PERMISSION), flags)); } catch (Exception e) { Log.v(TAG, "Couldn't request permission for USB device " + usbDevice); HIDDeviceOpenResult(deviceID, false); diff --git a/src/eepp/window/backend/SDL2/clipboardsdl2.cpp b/src/eepp/window/backend/SDL2/clipboardsdl2.cpp index 130ba8847..123ff5f42 100644 --- a/src/eepp/window/backend/SDL2/clipboardsdl2.cpp +++ b/src/eepp/window/backend/SDL2/clipboardsdl2.cpp @@ -50,11 +50,15 @@ std::string ClipboardSDL::getText() { } bool ClipboardSDL::hasPrimarySelection() const { +#if SDL_VERSION_ATLEAST( 2, 26, 0 ) return SDL_HasPrimarySelectionText(); +#else + return false; +#endif } std::string ClipboardSDL::getPrimarySelectionText() { -#if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN && SDL_VERSION_ATLEAST( 2, 26, 0 ) +#if SDL_VERSION_ATLEAST( 2, 26, 0 ) if ( SDL_HasPrimarySelectionText() ) { char* text = SDL_GetPrimarySelectionText(); std::string str( text ); @@ -67,7 +71,7 @@ std::string ClipboardSDL::getPrimarySelectionText() { } void ClipboardSDL::setPrimarySelectionText( const std::string& text ) { -#if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN && SDL_VERSION_ATLEAST( 2, 26, 0 ) +#if SDL_VERSION_ATLEAST( 2, 26, 0 ) if ( SDL_HasPrimarySelectionText() ) { SDL_SetPrimarySelectionText( text.c_str() ); } diff --git a/src/thirdparty/tabulate/tabulate.hpp b/src/thirdparty/tabulate/tabulate.hpp index 3c8d7d611..5e5332ee8 100644 --- a/src/thirdparty/tabulate/tabulate.hpp +++ b/src/thirdparty/tabulate/tabulate.hpp @@ -4145,22 +4145,22 @@ inline namespace literals { inline namespace string_view_literals { -constexpr std::string_view operator "" _sv( const char* str, size_t len ) noexcept // (1) +constexpr std::string_view operator""_sv( const char* str, size_t len ) noexcept // (1) { return std::string_view{ str, len }; } -constexpr std::u16string_view operator "" _sv( const char16_t* str, size_t len ) noexcept // (2) +constexpr std::u16string_view operator""_sv( const char16_t* str, size_t len ) noexcept // (2) { return std::u16string_view{ str, len }; } -constexpr std::u32string_view operator "" _sv( const char32_t* str, size_t len ) noexcept // (3) +constexpr std::u32string_view operator""_sv( const char32_t* str, size_t len ) noexcept // (3) { return std::u32string_view{ str, len }; } -constexpr std::wstring_view operator "" _sv( const wchar_t* str, size_t len ) noexcept // (4) +constexpr std::wstring_view operator""_sv( const wchar_t* str, size_t len ) noexcept // (4) { return std::wstring_view{ str, len }; }