Skip to content

Commit 3b112fc

Browse files
committed
Update ndk version
1 parent e3b1c3d commit 3b112fc

File tree

3 files changed

+24
-25
lines changed

3 files changed

+24
-25
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ android_arm64:
22
dart ./setup.dart android --arch arm64
33
macos_arm64:
44
dart ./setup.dart macos --arch arm64
5+
android_app:
6+
dart ./setup.dart android
57
android_arm64_core:
68
dart ./setup.dart android --arch arm64 --out core
79
macos_arm64_core:

android/core/src/main/cpp/CMakeLists.txt

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,25 @@ cmake_minimum_required(VERSION 3.22.1)
44
project("core")
55

66

7-
#if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
8-
# add_compile_options(-O3)
9-
#
10-
# add_compile_options(-flto)
11-
#
12-
# add_compile_options(-g0)
13-
#
14-
# add_compile_options(-ffunction-sections -fdata-sections)
15-
#
16-
# add_compile_options(-fno-exceptions -fno-rtti)
17-
#
18-
# add_link_options(
19-
# -flto
20-
# -Wl,--gc-sections
21-
# -Wl,--strip-all
22-
# -Wl,--exclude-libs=ALL
23-
# )
24-
#endif ()
7+
if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
8+
add_compile_options(-O3)
9+
10+
add_compile_options(-flto)
11+
12+
add_compile_options(-g0)
13+
14+
add_compile_options(-ffunction-sections -fdata-sections)
15+
16+
add_compile_options(-fno-exceptions -fno-rtti)
17+
18+
add_link_options(
19+
-flto
20+
-Wl,--gc-sections
21+
-Wl,--strip-all
22+
-Wl,--exclude-libs=ALL
23+
)
24+
endif ()
25+
2526
set(LIB_CLASH_PATH "${CMAKE_SOURCE_DIR}/../jniLibs/${ANDROID_ABI}/libclash.so")
2627
if (EXISTS ${LIB_CLASH_PATH})
2728
message(STATUS "Found libclash.so for ABI ${ANDROID_ABI}")

setup.dart

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ class Build {
199199
required Mode mode,
200200
required Target target,
201201
Arch? arch,
202-
bool stable = false,
203202
}) async {
204203
final isLib = mode == Mode.lib;
205204

@@ -238,17 +237,15 @@ class Build {
238237
if (isLib) {
239238
env["CGO_ENABLED"] = "1";
240239
env["CC"] = _getCc(item);
241-
if (stable) {
242-
env["CFLAGS"] = "-O3 -Werror";
243-
}
240+
env["CFLAGS"] = "-O3 -Werror";
244241
} else {
245242
env["CGO_ENABLED"] = "0";
246243
}
247244

248245
final execLines = [
249246
"go",
250247
"build",
251-
if (stable) "-ldflags=-w -s",
248+
"-ldflags=-w -s",
252249
"-tags=$tags",
253250
if (isLib) "-buildmode=c-shared",
254251
"-o",
@@ -473,7 +470,6 @@ class BuildCommand extends Command {
473470
target: target,
474471
arch: arch,
475472
mode: mode,
476-
stable: env == "stable"
477473
);
478474

479475
if (target == Target.windows) {
@@ -530,7 +526,7 @@ class BuildCommand extends Command {
530526
target: target,
531527
targets: "apk",
532528
args:
533-
"--flutter-build-args split-per-abi --build-target-platform ${defaultTargets.join(",")}",
529+
",split-per-abi --build-target-platform ${defaultTargets.join(",")}",
534530
env: env,
535531
);
536532
return;

0 commit comments

Comments
 (0)