Skip to content

Commit 0b8d292

Browse files
csmartdaltoncsmartdalton
andcommitted
Require Android NDK r27c from premake
Move the validation of this requirement from `build.rive.for.sh` into our core build system. Diffs= 52c045aaf7 Require Android NDK r27c from premake (#8900) Co-authored-by: Chris Dalton <[email protected]>
1 parent 146533b commit 0b8d292

File tree

3 files changed

+52
-11
lines changed

3 files changed

+52
-11
lines changed

.rive_head

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d5a774b4b46a147fd72e3ffd9dc730ab313d4a13
1+
52c045aaf73d9dac513a68c86323c956c0063136

build/rive_build_config.lua

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ newoption({
8181
{
8282
'runtime',
8383
'Build the static library specifically targeting our runtimes',
84-
}
84+
},
8585
},
8686
default = 'system',
8787
})
@@ -183,10 +183,10 @@ newoption({
183183
})
184184

185185
newoption({
186-
trigger= "toolsversion",
187-
value="msvc_toolsversion",
188-
description = "specify the version of the compiler tool. On windows thats the msvc version which affects both clang and msvc outputs.",
189-
default= 'latest'
186+
trigger = 'toolsversion',
187+
value = 'msvc_toolsversion',
188+
description = 'specify the version of the compiler tool. On windows thats the msvc version which affects both clang and msvc outputs.',
189+
default = 'latest',
190190
})
191191

192192
-- This is just to match our old windows config. Rive Native specifically sets
@@ -252,10 +252,10 @@ do
252252
end
253253

254254
-- for latest builds we leave toolsversion unset so that it automatically chooses the latest version
255-
filter({"options:toolsversion != latest"})
255+
filter({ 'options:toolsversion != latest' })
256256
do
257257
-- this is because unreal "prefers" certain msvc versions so we try to match it from the python build script
258-
toolsversion(_OPTIONS["toolsversion"])
258+
toolsversion(_OPTIONS['toolsversion'])
259259
end
260260

261261
filter({ 'system:windows', 'options:toolset=clang' })
@@ -353,9 +353,42 @@ filter({})
353353
if _OPTIONS['os'] == 'android' then
354354
pic('on') -- Position-independent code is required for NDK libraries.
355355

356-
ndk = os.getenv('NDK_PATH') or os.getenv('ANDROID_NDK')
357-
if not ndk then
358-
error('export $NDK_PATH or $ANDROID_NDK')
356+
-- Detect the NDK.
357+
EXPECTED_NDK_VERSION = 'r27c'
358+
ndk = os.getenv('NDK_PATH') or os.getenv('ANDROID_NDK') or '<undefined>'
359+
local ndk_version = '<undetected>'
360+
local f = io.open(ndk .. '/source.properties', 'r')
361+
if f then
362+
for line in f:lines() do
363+
local match = line:match('^Pkg.ReleaseName = (.+)$')
364+
if match then
365+
ndk_version = match
366+
break
367+
end
368+
end
369+
f:close()
370+
end
371+
if ndk_version ~= EXPECTED_NDK_VERSION then
372+
print()
373+
print('** Rive requires Android NDK version ' .. EXPECTED_NDK_VERSION .. ' **')
374+
print()
375+
print('To install via Android Studio:')
376+
print(' - Settings > SDK Manager > SDK Tools')
377+
print(' - Check "Show Package Details" at the bottom')
378+
print(' - Select 27.2.12479018 under "NDK (Side by side)"')
379+
print(' - Note the value of "Android SDK Location"')
380+
print()
381+
print('Then set the ANDROID_NDK environment variable:')
382+
print(' - export ANDROID_NDK="<Android SDK Location>/ndk/27.2.12479018"')
383+
print()
384+
error(
385+
'Unsupported Android NDK\n ndk: '
386+
.. ndk
387+
.. '\n version: '
388+
.. ndk_version
389+
.. '\n expected: '
390+
.. EXPECTED_NDK_VERSION
391+
)
359392
end
360393

361394
local ndk_toolchain = ndk .. '/toolchains/llvm/prebuilt'

tests/gm/gmmain.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ static void dumpGMs(const std::string& match, bool interactive)
7070
{
7171
continue; // A different process already drew this gm.
7272
}
73+
#ifdef RIVE_ANDROID
74+
if (gm->name().find("feather") != std::string::npos)
75+
{
76+
// Don't support or test feathering on Android until MSAA is
77+
// implemented and device-specific crashes are resolved.
78+
continue;
79+
}
80+
#endif
7381
gm->onceBeforeDraw();
7482

7583
dump_gm(gm.get());

0 commit comments

Comments
 (0)