Skip to content

Commit

Permalink
enable -00 for cmake/ndkbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Jun 1, 2020
1 parent 0946c54 commit de06bde
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {

release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
Expand Down
14 changes: 8 additions & 6 deletions nativelib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id 'org.tboox.gradle-xmake-plugin' version '1.1.0'
}

apply plugin: 'com.android.library'
//apply plugin: "org.tboox.gradle-xmake-plugin"

Expand All @@ -19,10 +18,9 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'

/*
ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
}*/
}

externalNativeBuild {

Expand All @@ -32,19 +30,21 @@ android {
abiFilters "armeabi-v7a", "arm64-v8a"
}*/

/*
xmake {
cppFlags "-DTEST", "-DTEST2"
buildMode "debug"
abiFilters "armeabi-v7a", "arm64-v8a"
}
}*/
}
}

externalNativeBuild {

/*
ndkBuild {
path "jni/Android.mk"
}*/
}
*/

/*
cmake {
Expand All @@ -54,6 +54,7 @@ android {
xmake {
logLevel "verbose"
path "jni/xmake.lua"
buildMode "debug"
//program /usr/local/bin/xmake
//stl "c++_shared"
//stdcxx false
Expand All @@ -63,6 +64,7 @@ android {
}

buildTypes {

release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
Expand Down
3 changes: 2 additions & 1 deletion nativelib/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ include $(CLEAR_VARS)
DEBUG := n
CRYPT := n
LOCAL_MODULE := nativelib
LOCAL_SRC_FILES := nativelib.cc
LOCAL_SRC_FILES := nativelib.cc
LOCAL_CXXFLAGS := -g -O0
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -L$(LOCAL_PATH) -llog -lz
include $(BUILD_SHARED_LIBRARY)

2 changes: 1 addition & 1 deletion nativelib/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.6.0)

# target
add_library(nativelib SHARED "")
target_compile_options(nativelib PRIVATE -Os)
target_compile_options(nativelib PRIVATE -O0 -g)
target_sources(nativelib PRIVATE
nativelib.cc
)
Expand Down

0 comments on commit de06bde

Please sign in to comment.