Skip to content

Commit 68a5c25

Browse files
committed
Fix build android with axmol cmdline arch not working
1 parent 3201244 commit 68a5c25

14 files changed

Lines changed: 48 additions & 37 deletions

File tree

1k/build.ps1

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ foreach ($arg in $args) {
240240
if (!$optName) {
241241
if ($arg.StartsWith('-')) {
242242
$optName = $arg.SubString(1)
243-
if($optName.EndsWith(':')) {
244-
$optName = $optName.TrimEnd(':')
243+
if($optName.EndsWith(':')) {
244+
$optName = $optName.TrimEnd(':')
245245
}
246246
if ($optName.startsWith('j')) {
247247
$job_count = $null
@@ -687,7 +687,7 @@ function setup_nuget() {
687687
}
688688

689689
# setup python3, not install automatically
690-
# ensure python3.exe is python.exe to solve unexpected error, i.e.
690+
# ensure python3.exe is python.exe to solve unexpected error, i.e.
691691
# google gclient require python3.exe, on windows 10/11 will locate to
692692
# a dummy C:\Users\halx99\AppData\Local\Microsoft\WindowsApps\python3.exe cause
693693
# shit strange error
@@ -718,7 +718,7 @@ function setup_glslcc() {
718718
$b1k.rmdirs($glslcc_bin)
719719
$glslcc_pkg = Join-Path $external_prefix "glslcc-$suffix"
720720
$b1k.del($glslcc_pkg)
721-
721+
722722
$glscc_url = devtool_url glslcc-$glslcc_ver-$suffix
723723

724724
download_and_expand $glscc_url "$glslcc_pkg" $glslcc_bin
@@ -854,7 +854,7 @@ function setup_nsis() {
854854
$nsis_prog, $nsis_ver = find_prog -name 'nsis' -cmd 'makensis' -params '/VERSION' -path $nsis_bin -silent $true
855855
if (!$nsis_prog) {
856856
$b1k.rmdirs($nsis_bin)
857-
857+
858858
download_and_expand "https://nchc.dl.sourceforge.net/project/nsis/NSIS%203/$nsis_ver/nsis-$nsis_ver.zip" "$external_prefix/nsis-$nsis_ver.zip" "$external_prefix"
859859
$nsis_dir = "$nsis_bin-$nsis_ver"
860860
if ($b1k.isdir($nsis_dir)) {
@@ -1196,7 +1196,7 @@ function setup_msvc() {
11961196
# google gn build system, current windows only for build angleproject/dawn on windows
11971197
function setup_gclient() {
11981198
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
1199-
1199+
12001200
if (!$ninja_prog) {
12011201
$ninja_prog = setup_ninja
12021202
}
@@ -1575,7 +1575,7 @@ if (!$setupOnly) {
15751575
}
15761576
}
15771577
}
1578-
1578+
15791579
if ($options.xt -ne 'gn') {
15801580
$BUILD_ALL_OPTIONS = @()
15811581
$BUILD_ALL_OPTIONS += $buildOptions
@@ -1654,7 +1654,7 @@ if (!$setupOnly) {
16541654
break
16551655
}
16561656
}
1657-
1657+
16581658
if (!$BUILD_DIR) {
16591659
$BUILD_DIR = resolve_out_dir $cmake_build_prefix 'build_'
16601660
}
@@ -1703,7 +1703,11 @@ if (!$setupOnly) {
17031703
}
17041704
}
17051705
else {
1706-
& $build_tool tasks
1706+
if ($optimize_flag -eq 'Debug') {
1707+
& $build_tool configureCMakeDebug prepareKotlinBuildScriptModel $CONFIG_ALL_OPTIONS | Out-Host
1708+
} else {
1709+
& $build_tool configureCMakeRelWithDebInfo prepareKotlinBuildScriptModel $CONFIG_ALL_OPTIONS | Out-Host
1710+
}
17071711
}
17081712
Pop-Location
17091713
}
@@ -1748,7 +1752,7 @@ if (!$setupOnly) {
17481752
# apply additional build options
17491753
$BUILD_ALL_OPTIONS += "--parallel"
17501754
$BUILD_ALL_OPTIONS += "$($options.j)"
1751-
1755+
17521756
if (($cmake_generator -eq 'Xcode') -and !$BUILD_ALL_OPTIONS.Contains('--verbose')) {
17531757
$BUILD_ALL_OPTIONS += '--', '-quiet'
17541758
}
@@ -1767,10 +1771,10 @@ if (!$setupOnly) {
17671771
else {
17681772
# google gclient/gn build system
17691773
# refer: https://chromium.googlesource.com/chromium/src/+/eca97f87e275a7c9c5b7f13a65ff8635f0821d46/tools/gn/docs/reference.md#args_specifies-build-arguments-overrides-examples
1770-
1774+
17711775
$stored_env_path = $null
17721776
$gn_buildargs_overrides = @()
1773-
1777+
17741778
if ($Global:is_winrt) {
17751779
$gn_buildargs_overrides += 'target_os=\"winuwp\"'
17761780
}
@@ -1808,7 +1812,7 @@ if (!$setupOnly) {
18081812
}
18091813

18101814
Write-Output ("gn_buildargs_overrides=$gn_buildargs_overrides, Count={0}" -f $gn_buildargs_overrides.Count)
1811-
1815+
18121816
$BUILD_DIR = resolve_out_dir $null 'out/'
18131817

18141818
if ($rebuild) {

core/platform/android/libaxmol/axutils.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ class axutils {
102102
if (project.properties.__1K_CMAKE_VERSION != null)
103103
cmakeVer = project.properties.__1K_CMAKE_VERSION
104104

105-
if (project.properties.__ARCHS != null)
106-
project.properties.PROP_APP_ABI = project.properties.__ARCHS
107-
108105
// Detecting sdkRoot
109106
def sdkRoot = null
110107
Properties localProps = new Properties()

docs/DevSetup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Note: if you use non-SDK provided CMake, you will need to download `ninja` from
150150
set ANDROID_HOME=D:\dev\adt\sdk
151151
152152
# Goto xxx\proj.android
153-
.\gradlew.bat assembleRelease -PPROP_BUILD_TYPE=cmake -PPROP_APP_ABI=arm64-v8a --parallel --info
153+
.\gradlew.bat assembleRelease -P__1K_ARCHS=arm64-v8a --parallel --info
154154
```
155155

156156
### iOS, tvOS and macOS

setup.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,4 +342,19 @@ if ($updateGradleVersion) {
342342
update_gradle_for_test 'lua-tests'
343343
}
344344

345+
if ($IsLinux -and (Test-Path '/etc/wsl.conf' -PathType Leaf)) {
346+
Write-Host "Are want remove host windows path from wsl? (y/n) " -NoNewline
347+
$answer = Read-Host
348+
if ($answer -like 'y*') {
349+
$wsl_conf = [System.IO.File]::ReadAllText('/etc/wsl.conf')
350+
if (!$wsl_conf.Contains('appendWindowsPath')) {
351+
$wsl_conf += "`n[interop]`nappendWindowsPath = false"
352+
$wsl_conf_tmp_file = (Join-Path $AX_ROOT 'wsl.conf')
353+
[System.IO.File]::WriteAllText($wsl_conf_tmp_file, $wsl_conf)
354+
sudo mv -f $wsl_conf_tmp_file /etc/wsl.conf
355+
println "Update /etc/wsl.conf success, please run 'wsl --shutdown' on your host windows, then re-enter wsl"
356+
}
357+
}
358+
}
359+
345360
$b1k.pause("setup successfully, please restart the terminal to make added system variables take effect")

templates/common/proj.android/app/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ android {
3030
}
3131

3232
ndk {
33-
abiFilters = []
34-
abiFilters.addAll(PROP_APP_ABI.split(':').collect{it as String})
33+
abiFilters = __1K_ARCHS.split(':').collect{it as String}
3534
}
3635
}
3736

templates/common/proj.android/gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ PROP_TARGET_SDK_VERSION=34
2828
# List of CPU Archtexture to build that application with
2929
# Available architextures (armeabi-v7a | arm64-v8a | x86)
3030
# To build for multiple architexture, use the `:` between them
31-
# Example - PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86
32-
PROP_APP_ABI=arm64-v8a
31+
# Example - __1K_ARCHS=armeabi-v7a:arm64-v8a:x86
32+
__1K_ARCHS=arm64-v8a
3333

3434
# uncomment it and fill in sign information for generate signed apk
3535
#KEY_STORE_FILE=file path of keystore

tests/cpp-tests/proj.android/app/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ android {
3131
}
3232

3333
ndk {
34-
abiFilters = []
35-
abiFilters.addAll(PROP_APP_ABI.split(':').collect{it as String})
34+
abiFilters = __1K_ARCHS.split(':').collect{it as String}
3635
}
3736
}
3837

tests/cpp-tests/proj.android/gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ PROP_TARGET_SDK_VERSION=34
2828
# List of CPU Archtexture to build that application with
2929
# Available architextures (armeabi-v7a | arm64-v8a | x86)
3030
# To build for multiple architexture, use the `:` between them
31-
# Example - PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86
32-
PROP_APP_ABI=arm64-v8a
31+
# Example - __1K_ARCHS=armeabi-v7a:arm64-v8a:x86
32+
__1K_ARCHS=arm64-v8a
3333

3434
# uncomment it and fill in sign information for generate signed apk
3535
#KEY_STORE_FILE=file path of keystore

tests/fairygui-tests/proj.android/app/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ android {
3131
}
3232

3333
ndk {
34-
abiFilters = []
35-
abiFilters.addAll(PROP_APP_ABI.split(':').collect{it as String})
34+
abiFilters = __1K_ARCHS.split(':').collect{it as String}
3635
}
3736
}
3837

tests/fairygui-tests/proj.android/gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ PROP_TARGET_SDK_VERSION=34
2828
# List of CPU Archtexture to build that application with
2929
# Available architextures (armeabi-v7a | arm64-v8a | x86)
3030
# To build for multiple architexture, use the `:` between them
31-
# Example - PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86
32-
PROP_APP_ABI=arm64-v8a
31+
# Example - __1K_ARCHS=armeabi-v7a:arm64-v8a:x86
32+
__1K_ARCHS=arm64-v8a
3333

3434
# uncomment it and fill in sign information for generate signed apk
3535
# KEY_STORE_FILE=path/to/keystore.jks

0 commit comments

Comments
 (0)