mirror of
https://github.com/xerial/snappy-java.git
synced 2025-06-01 12:40:14 +02:00
Update Makefile to support SSE2 only in linux/x86_64
This commit is contained in:
parent
eeb5a811b4
commit
d39b23f35b
19
Makefile
19
Makefile
@ -34,15 +34,22 @@ $(BITSHUFFLE_SRC): $(BITSHUFFLE_UNPACKED)
|
|||||||
|
|
||||||
$(SNAPPY_OUT)/%.o: $(BITSHUFFLE_SRC_DIR)/%.c
|
$(SNAPPY_OUT)/%.o: $(BITSHUFFLE_SRC_DIR)/%.c
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
$(CXX) $(CXXFLAGS) $(CXXFLAGS_BITSHUFFLE) -c $< -o $@
|
||||||
|
|
||||||
SNAPPY_OBJ:=$(addprefix $(SNAPPY_OUT)/,$(patsubst %.cc,%.o,$(SNAPPY_CC)) $(patsubst %.c,%.o,$(BITSHUFFLE_C)) SnappyNative.o BitShuffleNative.o)
|
SNAPPY_OBJ:=$(addprefix $(SNAPPY_OUT)/,$(patsubst %.cc,%.o,$(SNAPPY_CC)) $(patsubst %.c,%.o,$(BITSHUFFLE_C)) SnappyNative.o BitShuffleNative.o)
|
||||||
|
|
||||||
ifdef UNIVERSAL_BITSHUFFLE
|
CXXFLAGS:=$(CXXFLAGS) -I$(SNAPPY_SRC_DIR) -I$(BITSHUFFLE_SRC_DIR)
|
||||||
# Undefined macros to generate a platform-independent binary
|
|
||||||
CXXFLAGS:=$(CXXFLAGS) -U__AVX2__ -U__SSE2__ -I$(SNAPPY_SRC_DIR) -I$(BITSHUFFLE_SRC_DIR)
|
ifndef CXXFLAGS_BITSHUFFLE
|
||||||
else
|
ifeq ($(OS_NAME)-$(OS_ARCH),Linux-x86_64)
|
||||||
CXXFLAGS:=$(CXXFLAGS) -I$(SNAPPY_SRC_DIR) -I$(BITSHUFFLE_SRC_DIR)
|
# SSE2 is supported in all the x86_64 platforms and AVX2 is only supported
|
||||||
|
# in the small part of them. gcc in linux/x86_64 typically enables SSE2 by default though,
|
||||||
|
# we explicitly set flags below to make this precondition clearer.
|
||||||
|
CXXFLAGS_BITSHUFFLE:=-U__AVX2__ -msse2
|
||||||
|
else
|
||||||
|
# Undefined macros to generate a platform-independent binary
|
||||||
|
CXXFLAGS_BITSHUFFLE:=-U__AVX2__ -U__SSE2__
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OS_NAME),SunOS)
|
ifeq ($(OS_NAME),SunOS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user