From 9e4c47b599d708596d867d7d3bb20cae318f6544 Mon Sep 17 00:00:00 2001 From: leleliu008 Date: Fri, 19 Apr 2024 14:09:25 +0800 Subject: [PATCH] optimized Signed-off-by: leleliu008 --- README.md | 2 +- ndk-pkg | 7 +++++++ wrapper-target-c++.c | 17 ++++++++++++++++- wrapper-target-cc.c | 17 ++++++++++++++++- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7aed34a..ad7079b 100644 --- a/README.md +++ b/README.md @@ -148,10 +148,10 @@ a typical hierarchical structure under `~/.ndk-pkg` directory looks like below: ├── core │   ├── SourceCodePro-Light.otf │   ├── cacert.pem +│   ├── env.sh │   ├── fonts.conf │   ├── ndk-pkg-core-2024.05.15-linux-x86_64.tar.xz │   ├── ndk-pkg-core-latest-release-version -│   ├── profile │   ├── sed-in-place │   ├── uppm │   ├── wrapper-native-cc diff --git a/ndk-pkg b/ndk-pkg index 832ec19..4edbf52 100755 --- a/ndk-pkg +++ b/ndk-pkg @@ -4382,6 +4382,13 @@ inspect_install_arguments() { ######################################################################################### + case $REQUEST_TO_CREATE_EXE_TYPE in + '') REQUEST_TO_CREATE_EXE_TYPE=pie ;; + msle) export NDKPKG_CREATE_MOSTLY_STATICALLY_LINKED_EXECUTABLE=1 ;; + esac + + ######################################################################################### + if [ -z "$PROFILE" ] ; then PROFILE=release fi diff --git a/wrapper-target-c++.c b/wrapper-target-c++.c index a2ce7ae..c5ae773 100644 --- a/wrapper-target-c++.c +++ b/wrapper-target-c++.c @@ -87,7 +87,22 @@ int main(int argc, char * argv[]) { for (int j = 0; j < 6; j++) { if (strcmp(argv[i], actions[j]) == 0) { indexes[j] = i; - break; + + if (indexes[0] > 0) { + break; + } + + if (indexes[1] > 0) { + break; + } + + if (indexes[2] > 0) { + break; + } + + if (indexes[3] > 0) { + break; + } } } } diff --git a/wrapper-target-cc.c b/wrapper-target-cc.c index e497195..bcea66b 100644 --- a/wrapper-target-cc.c +++ b/wrapper-target-cc.c @@ -87,7 +87,22 @@ int main(int argc, char * argv[]) { for (int j = 0; j < 6; j++) { if (strcmp(argv[i], actions[j]) == 0) { indexes[j] = i; - break; + + if (indexes[0] > 0) { + break; + } + + if (indexes[1] > 0) { + break; + } + + if (indexes[2] > 0) { + break; + } + + if (indexes[3] > 0) { + break; + } } } }