mirror of
https://github.com/facebook/zstd.git
synced 2025-11-09 00:11:14 -05:00
Merge pull request #2119 from bimbashrestha/mingw
[build] Adding $TARGET_SYSTEM for cross-compilation Fedora fix
This commit is contained in:
commit
602dae3509
11
Makefile
11
Makefile
@ -18,7 +18,16 @@ FUZZDIR = $(TESTDIR)/fuzz
|
|||||||
# Define nul output
|
# Define nul output
|
||||||
VOID = /dev/null
|
VOID = /dev/null
|
||||||
|
|
||||||
ifneq (,$(filter Windows%,$(OS)))
|
# When cross-compiling from linux to windows, you might
|
||||||
|
# need to specify this as "Windows." Fedora build fails
|
||||||
|
# without it.
|
||||||
|
#
|
||||||
|
# Note: mingw-w64 build from linux to windows does not
|
||||||
|
# fail on other tested distros (ubuntu, debian) even
|
||||||
|
# without manually specifying the TARGET_SYSTEM.
|
||||||
|
TARGET_SYSTEM ?= $(OS)
|
||||||
|
|
||||||
|
ifneq (,$(filter Windows%,$(TARGET_SYSTEM)))
|
||||||
EXT =.exe
|
EXT =.exe
|
||||||
else
|
else
|
||||||
EXT =
|
EXT =
|
||||||
|
|||||||
13
lib/Makefile
13
lib/Makefile
@ -10,6 +10,15 @@
|
|||||||
|
|
||||||
Q = $(if $(filter 1,$(V) $(VERBOSE)),,@)
|
Q = $(if $(filter 1,$(V) $(VERBOSE)),,@)
|
||||||
|
|
||||||
|
# When cross-compiling from linux to windows, you might
|
||||||
|
# need to specify this as "Windows." Fedora build fails
|
||||||
|
# without it.
|
||||||
|
#
|
||||||
|
# Note: mingw-w64 build from linux to windows does not
|
||||||
|
# fail on other tested distros (ubuntu, debian) even
|
||||||
|
# without manually specifying the TARGET_SYSTEM.
|
||||||
|
TARGET_SYSTEM ?= $(OS)
|
||||||
|
|
||||||
# Version numbers
|
# Version numbers
|
||||||
LIBVER_MAJOR_SCRIPT:=`sed -n '/define ZSTD_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./zstd.h`
|
LIBVER_MAJOR_SCRIPT:=`sed -n '/define ZSTD_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./zstd.h`
|
||||||
LIBVER_MINOR_SCRIPT:=`sed -n '/define ZSTD_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./zstd.h`
|
LIBVER_MINOR_SCRIPT:=`sed -n '/define ZSTD_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./zstd.h`
|
||||||
@ -23,7 +32,7 @@ VERSION?= $(LIBVER)
|
|||||||
CCVER := $(shell $(CC) --version)
|
CCVER := $(shell $(CC) --version)
|
||||||
|
|
||||||
CPPFLAGS+= -DXXH_NAMESPACE=ZSTD_
|
CPPFLAGS+= -DXXH_NAMESPACE=ZSTD_
|
||||||
ifeq ($(OS),Windows_NT) # MinGW assumed
|
ifeq ($(TARGET_SYSTEM),Windows_NT) # MinGW assumed
|
||||||
CPPFLAGS += -D__USE_MINGW_ANSI_STDIO # compatibility with %zu formatting
|
CPPFLAGS += -D__USE_MINGW_ANSI_STDIO # compatibility with %zu formatting
|
||||||
endif
|
endif
|
||||||
DEBUGFLAGS= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
|
DEBUGFLAGS= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
|
||||||
@ -182,7 +191,7 @@ libzstd.a: $(ZSTD_OBJ)
|
|||||||
@echo compiling static library
|
@echo compiling static library
|
||||||
$(Q)$(AR) $(ARFLAGS) $@ $^
|
$(Q)$(AR) $(ARFLAGS) $@ $^
|
||||||
|
|
||||||
ifneq (,$(filter Windows%,$(OS)))
|
ifneq (,$(filter Windows%,$(TARGET_SYSTEM)))
|
||||||
|
|
||||||
LIBZSTD = dll\libzstd.dll
|
LIBZSTD = dll\libzstd.dll
|
||||||
$(LIBZSTD): $(ZSTD_FILES)
|
$(LIBZSTD): $(ZSTD_FILES)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user