Skip to content

Commit 9d7d1d2

Browse files
authored
libretro: reenable android build (#1124)
1 parent 2da2e05 commit 9d7d1d2

File tree

2 files changed

+33
-13
lines changed

2 files changed

+33
-13
lines changed

.gitlab-ci.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,22 +100,28 @@ libretro-build-osx-arm64:
100100

101101
################################### CELLULAR #################################
102102
# Android ARMv7a
103-
# android-armeabi-v7a:
104-
# extends:
105-
# - .libretro-android-jni-armeabi-v7a
106-
# - .core-defs
103+
android-armeabi-v7a:
104+
extends:
105+
- .libretro-android-jni-armeabi-v7a
106+
- .core-defs
107+
variables:
108+
NDK_ROOT: /android-sdk-linux/ndk/26.2.11394342
107109

108110
# Android ARMv8a
109-
# android-arm64-v8a:
110-
# extends:
111-
# - .libretro-android-jni-arm64-v8a
112-
# - .core-defs
111+
android-arm64-v8a:
112+
extends:
113+
- .libretro-android-jni-arm64-v8a
114+
- .core-defs
115+
variables:
116+
NDK_ROOT: /android-sdk-linux/ndk/26.2.11394342
113117

114118
# Android 64-bit x86
115-
# android-x86_64:
116-
# extends:
117-
# - .libretro-android-jni-x86_64
118-
# - .core-defs
119+
android-x86_64:
120+
extends:
121+
- .libretro-android-jni-x86_64
122+
- .core-defs
123+
variables:
124+
NDK_ROOT: /android-sdk-linux/ndk/26.2.11394342
119125

120126
# iOS
121127
libretro-build-ios-arm64:

src/common/bspf.hxx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,23 @@ using std::istream;
7070
using std::ostream;
7171
using std::fstream;
7272
using std::iostream;
73-
using std::ostringstream;
7473
using std::istringstream;
74+
// Android NDK 26 libc++ lacks ostringstream::view() (C++20 P0408R7)
75+
#if defined(__ANDROID__) && !defined(__cpp_lib_sstream_from_string_view)
76+
class ostringstream : public std::ostringstream {
77+
public:
78+
using std::ostringstream::ostringstream;
79+
std::string view() const { return str(); }
80+
};
81+
class stringstream : public std::stringstream {
82+
public:
83+
using std::stringstream::stringstream;
84+
std::string view() const { return str(); }
85+
};
86+
#else
87+
using std::ostringstream;
7588
using std::stringstream;
89+
#endif
7690
using std::unique_ptr;
7791
using std::shared_ptr;
7892
using std::make_unique;

0 commit comments

Comments
 (0)