diff --git a/DroidFishApp/build.gradle b/DroidFishApp/build.gradle index 7a7171b..45986e6 100644 --- a/DroidFishApp/build.gradle +++ b/DroidFishApp/build.gradle @@ -78,6 +78,7 @@ preBuild.dependsOn buildEco task copyToAssets(type: Copy, dependsOn: 'externalNativeBuildRelease') { from('build/intermediates/ndkBuild/release/obj/local') { include '*/stockfish' + include '*/stockfish_nosimd' } into 'src/main/assets' } diff --git a/DroidFishApp/src/main/cpp/stockfish/Android.mk b/DroidFishApp/src/main/cpp/stockfish/Android.mk index da13c07..7a83390 100644 --- a/DroidFishApp/src/main/cpp/stockfish/Android.mk +++ b/DroidFishApp/src/main/cpp/stockfish/Android.mk @@ -23,8 +23,20 @@ endif include $(CLEAR_VARS) LOCAL_MODULE := stockfish -LOCAL_SRC_FILES := $(SF_SRC_FILES) -LOCAL_CFLAGS := -std=c++17 -O2 -fno-exceptions -DNNUE_EMBEDDING_OFF \ - -fPIE $(MY_ARCH_DEF) -s -LOCAL_LDFLAGS += -fPIE -pie -s -include $(BUILD_EXECUTABLE) +include $(LOCAL_PATH)/build_sf.mk + +ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) + MY_ARCH_DEF := + include $(CLEAR_VARS) + LOCAL_MODULE := stockfish_nosimd + include $(LOCAL_PATH)/build_sf.mk + stockfish : stockfish_nosimd +endif + +ifeq ($(TARGET_ARCH_ABI),x86) + MY_ARCH_DEF := + include $(CLEAR_VARS) + LOCAL_MODULE := stockfish_nosimd + include $(LOCAL_PATH)/build_sf.mk + stockfish : stockfish_nosimd +endif diff --git a/DroidFishApp/src/main/cpp/stockfish/build_sf.mk b/DroidFishApp/src/main/cpp/stockfish/build_sf.mk new file mode 100644 index 0000000..b7f06a9 --- /dev/null +++ b/DroidFishApp/src/main/cpp/stockfish/build_sf.mk @@ -0,0 +1,5 @@ +LOCAL_SRC_FILES := $(SF_SRC_FILES) +LOCAL_CFLAGS := -std=c++17 -O2 -fno-exceptions -DNNUE_EMBEDDING_OFF \ + -fPIE $(MY_ARCH_DEF) -s +LOCAL_LDFLAGS += -fPIE -pie -s +include $(BUILD_EXECUTABLE)