[core] Add missing NDEBUG
This commit is contained in:
parent
1ded91da62
commit
0109da15d8
|
|
@ -158,11 +158,15 @@ android {
|
||||||
)
|
)
|
||||||
cppFlags.addAll(flags)
|
cppFlags.addAll(flags)
|
||||||
cFlags.addAll(flags)
|
cFlags.addAll(flags)
|
||||||
|
val configFlags = arrayOf(
|
||||||
|
"-Oz",
|
||||||
|
"-DNDEBUG"
|
||||||
|
).joinToString(" ")
|
||||||
arguments.addAll(arrayOf(
|
arguments.addAll(arrayOf(
|
||||||
"-DCMAKE_CXX_FLAGS_RELEASE=-Oz",
|
"-DCMAKE_CXX_FLAGS_RELEASE=$configFlags",
|
||||||
"-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-Oz",
|
"-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=$configFlags",
|
||||||
"-DCMAKE_C_FLAGS_RELEASE=-Oz",
|
"-DCMAKE_C_FLAGS_RELEASE=$configFlags",
|
||||||
"-DCMAKE_C_FLAGS_RELWITHDEBINFO=-Oz"
|
"-DCMAKE_C_FLAGS_RELWITHDEBINFO=$configFlags"
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,10 +57,14 @@ namespace lspd {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Context::PreLoadDex(const std::string &dex_path) {
|
void Context::PreLoadDex(std::string_view dex_path) {
|
||||||
if (LIKELY(!dex.empty())) return;
|
if (LIKELY(!dex.empty())) return;
|
||||||
|
|
||||||
FILE *f = fopen(dex_path.c_str(), "rb");
|
FILE *f = fopen(dex_path.data(), "rb");
|
||||||
|
if (!f) {
|
||||||
|
LOGE("Fail to open dex from %s", dex_path.data());
|
||||||
|
return;
|
||||||
|
}
|
||||||
fseek(f, 0, SEEK_END);
|
fseek(f, 0, SEEK_END);
|
||||||
dex.resize(ftell(f));
|
dex.resize(ftell(f));
|
||||||
rewind(f);
|
rewind(f);
|
||||||
|
|
@ -70,7 +74,7 @@ namespace lspd {
|
||||||
}
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
LOGI("Loaded %s with size %zu", dex_path.c_str(), dex.size());
|
LOGI("Loaded %s with size %zu", dex_path.data(), dex.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Context::LoadDex(JNIEnv *env) {
|
void Context::LoadDex(JNIEnv *env) {
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ namespace lspd {
|
||||||
|
|
||||||
void OnNativeForkSystemServerPre(JNIEnv *env);
|
void OnNativeForkSystemServerPre(JNIEnv *env);
|
||||||
|
|
||||||
void PreLoadDex(const std::string &dex_paths);
|
void PreLoadDex(std::string_view dex_paths);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
inline static std::unique_ptr<Context> instance_ = std::make_unique<Context>();
|
inline static std::unique_ptr<Context> instance_ = std::make_unique<Context>();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue