Skip to content

Commit a450805

Browse files
committed
Optimize for aarch64 big-endian
1 parent 1b7cc64 commit a450805

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ $(SNAPPY_GIT_UNPACKED):
8181

8282
$(SNAPPY_CMAKE_CACHE): $(SNAPPY_GIT_UNPACKED)
8383
@mkdir -p $(SNAPPY_OUT)
84-
cd $(SNAPPY_OUT) && cmake $(SNAPPY_CMAKE_OPTS) -DCMAKE_CXX_COMPILER=$(CXX) ../../$(SNAPPY_SRC_DIR)
84+
cd $(SNAPPY_OUT) && cmake $(SNAPPY_CMAKE_OPTS) ../../$(SNAPPY_SRC_DIR)
8585
touch $@
8686

8787
jni-header: $(SNAPPY_GIT_UNPACKED) $(BITSHUFFLE_UNPACKED) $(SRC)/org/xerial/snappy/SnappyNative.h $(SRC)/org/xerial/snappy/BitShuffleNative.h
@@ -109,6 +109,11 @@ ifeq ($(OS_NAME),Windows)
109109
SNAPPY_CXX_OPTS:=-include$(SNAPPY_OUT)/snappy-stubs-public.h
110110
endif
111111

112+
# aarch64 can use big-endian optimzied code
113+
ifeq ($(OS_ARCH),aarch64)
114+
SNAPPY_CXX_OPTS:=-DSNAPPY_IS_BIG_ENDIAN
115+
endif
116+
112117
$(SNAPPY_OUT)/%.o: $(SNAPPY_SRC_DIR)/%.cc
113118
@mkdir -p $(@D)
114119
$(CXX) $(SNAPPY_CXX_OPTS) $(CXXFLAGS) -c $< -o $@
Binary file not shown.

0 commit comments

Comments
 (0)