@@ -81,7 +81,7 @@ newoption({
81
81
{
82
82
' runtime' ,
83
83
' Build the static library specifically targeting our runtimes' ,
84
- }
84
+ },
85
85
},
86
86
default = ' system' ,
87
87
})
@@ -183,10 +183,10 @@ newoption({
183
183
})
184
184
185
185
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' ,
190
190
})
191
191
192
192
-- This is just to match our old windows config. Rive Native specifically sets
252
252
end
253
253
254
254
-- 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' })
256
256
do
257
257
-- 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' ])
259
259
end
260
260
261
261
filter ({ ' system:windows' , ' options:toolset=clang' })
@@ -353,9 +353,42 @@ filter({})
353
353
if _OPTIONS [' os' ] == ' android' then
354
354
pic (' on' ) -- Position-independent code is required for NDK libraries.
355
355
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
+ )
359
392
end
360
393
361
394
local ndk_toolchain = ndk .. ' /toolchains/llvm/prebuilt'
0 commit comments