Build non-SIMD versions of Stockfish engine

Will be used for CPUs that don't support the best SIMD instructions.
This commit is contained in:
Peter Osterlund 2020-09-13 15:51:12 +02:00
parent bec49dc5a7
commit 105ae49b01
3 changed files with 23 additions and 5 deletions

View File

@ -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'
}

View File

@ -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

View File

@ -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)