From 652d6dce6149b746ca96a7be22b6e37797dc4d2d Mon Sep 17 00:00:00 2001 From: LoveSy Date: Thu, 18 Jul 2024 16:54:19 +0800 Subject: [PATCH] Fix native build --- app/build.gradle.kts | 2 ++ app/src/main/jni/CMakeLists.txt | 1 - app/src/main/jni/biliroaming.cc | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 8a4c5a8940..aa68295907 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -39,6 +39,8 @@ cmaker { "-DCMAKE_CXX_STANDARD=23", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON", ) + cFlags += "-flto" + cppFlags += "-flto" } buildTypes { diff --git a/app/src/main/jni/CMakeLists.txt b/app/src/main/jni/CMakeLists.txt index c11a7f6de5..4fd6fdd3f6 100644 --- a/app/src/main/jni/CMakeLists.txt +++ b/app/src/main/jni/CMakeLists.txt @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 3.28) project(biliroaming) -set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_SCAN_FOR_MODULES ON) find_package(cxx REQUIRED CONFIG) diff --git a/app/src/main/jni/biliroaming.cc b/app/src/main/jni/biliroaming.cc index 6910cc508a..bb87a9a257 100644 --- a/app/src/main/jni/biliroaming.cc +++ b/app/src/main/jni/biliroaming.cc @@ -1,4 +1,6 @@ +#include #include +#include #include #include #include