mirror of
https://github.com/facebook/zstd.git
synced 2025-07-30 22:23:13 +03:00
fix cmakebuild test
write it in a way which is more compatible with older versions of cmake (<3.13) Also: fix pzstd compilation (notably on macos)
This commit is contained in:
9
.github/workflows/dev-short-tests.yml
vendored
9
.github/workflows/dev-short-tests.yml
vendored
@ -80,19 +80,16 @@ jobs:
|
|||||||
make clean
|
make clean
|
||||||
LDFLAGS=-Wl,--no-undefined make -C lib libzstd-mt
|
LDFLAGS=-Wl,--no-undefined make -C lib libzstd-mt
|
||||||
|
|
||||||
# candidate test (to check) : underlink test
|
# candidate test (for discussion) : underlink test
|
||||||
# LDFLAGS=-Wl,--no-undefined : will make the linker fail if dll is underlinked
|
# LDFLAGS=-Wl,--no-undefined : will make the linker fail if dll is underlinked
|
||||||
|
|
||||||
cmake-build-and-test-check:
|
cmake-build-and-test-check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag=v3
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag=v3
|
||||||
- name: cmake build and test check
|
- name: cmake build and test
|
||||||
run: |
|
run: |
|
||||||
FUZZERTEST=-T1mn ZSTREAM_TESTTIME=-T1mn make cmakebuild
|
FUZZERTEST=-T1mn ZSTREAM_TESTTIME=-T1mn make cmakebuild V=1
|
||||||
cp -r ./ "../zstd source"
|
|
||||||
cd "../zstd source"
|
|
||||||
FUZZERTEST=-T1mn ZSTREAM_TESTTIME=-T1mn make cmakebuild
|
|
||||||
|
|
||||||
cpp-gnu90-c99-compatibility:
|
cpp-gnu90-c99-compatibility:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -27,6 +27,8 @@ tmp*
|
|||||||
dictionary.
|
dictionary.
|
||||||
dictionary
|
dictionary
|
||||||
NUL
|
NUL
|
||||||
|
cmakebuild/
|
||||||
|
install/
|
||||||
|
|
||||||
# Build artefacts
|
# Build artefacts
|
||||||
contrib/linux-kernel/linux/
|
contrib/linux-kernel/linux/
|
||||||
|
32
Makefile
32
Makefile
@ -145,7 +145,7 @@ clean:
|
|||||||
$(Q)$(MAKE) -C contrib/largeNbDicts $@ > $(VOID)
|
$(Q)$(MAKE) -C contrib/largeNbDicts $@ > $(VOID)
|
||||||
$(Q)$(MAKE) -C contrib/externalSequenceProducer $@ > $(VOID)
|
$(Q)$(MAKE) -C contrib/externalSequenceProducer $@ > $(VOID)
|
||||||
$(Q)$(RM) zstd$(EXT) zstdmt$(EXT) tmp*
|
$(Q)$(RM) zstd$(EXT) zstdmt$(EXT) tmp*
|
||||||
$(Q)$(RM) -r lz4
|
$(Q)$(RM) -r lz4 cmakebuild install
|
||||||
@echo Cleaning completed
|
@echo Cleaning completed
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
@ -389,28 +389,32 @@ lz4install:
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON -DCMAKE_BUILD_TYPE=Release
|
|
||||||
|
|
||||||
ifneq (,$(filter MSYS%,$(shell uname)))
|
ifneq (,$(filter MSYS%,$(shell uname)))
|
||||||
HOST_OS = MSYS
|
HOST_OS = MSYS
|
||||||
CMAKE_PARAMS = -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
# target specific tests
|
# target specific tests
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
ifneq (,$(filter $(HOST_OS),MSYS POSIX))
|
ifneq (,$(filter $(HOST_OS),MSYS POSIX))
|
||||||
.PHONY: cmakebuild c89build gnu90build c99build gnu99build c11build bmix64build bmix32build bmi32build staticAnalyze
|
|
||||||
cmakebuild:
|
|
||||||
cmake --version
|
|
||||||
$(RM) -r $(BUILDIR)/cmake/build
|
|
||||||
$(MKDIR) $(BUILDIR)/cmake/build
|
|
||||||
cd $(BUILDIR)/cmake/build; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) ..
|
|
||||||
$(MAKE) -C $(BUILDIR)/cmake/build -j4;
|
|
||||||
$(MAKE) -C $(BUILDIR)/cmake/build install;
|
|
||||||
$(MAKE) -C $(BUILDIR)/cmake/build uninstall;
|
|
||||||
cd $(BUILDIR)/cmake/build; ctest -V -L Medium
|
|
||||||
|
|
||||||
|
CMAKE ?= cmake
|
||||||
|
CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON
|
||||||
|
|
||||||
|
ifneq (,$(filter MSYS%,$(shell uname)))
|
||||||
|
CMAKE_PARAMS = -G"MSYS Makefiles" -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON
|
||||||
|
endif
|
||||||
|
|
||||||
|
.PHONY: cmakebuild
|
||||||
|
cmakebuild:
|
||||||
|
$(CMAKE) --version
|
||||||
|
$(RM) -r cmakebuild install
|
||||||
|
$(MKDIR) cmakebuild install
|
||||||
|
cd cmakebuild; $(CMAKE) -Wdev -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-Werror -O0" -DCMAKE_INSTALL_PREFIX=install $(CMAKE_PARAMS) ../build/cmake
|
||||||
|
$(CMAKE) --build cmakebuild --target install -- -j V=1
|
||||||
|
cd cmakebuild; ctest -V -L Medium
|
||||||
|
|
||||||
|
.PHONY: c89build gnu90build c99build gnu99build c11build bmix64build bmix32build bmi32build staticAnalyze
|
||||||
c89build: clean
|
c89build: clean
|
||||||
$(CC) -v
|
$(CC) -v
|
||||||
CFLAGS="-std=c89 -Werror -Wno-attributes -Wpedantic -Wno-long-long -Wno-variadic-macros -O0" $(MAKE) lib zstd
|
CFLAGS="-std=c89 -Werror -Wno-attributes -Wpedantic -Wno-long-long -Wno-variadic-macros -O0" $(MAKE) lib zstd
|
||||||
|
@ -18,6 +18,7 @@ set(PZSTD_DIR ${ZSTD_SOURCE_DIR}/contrib/pzstd)
|
|||||||
include_directories(${PROGRAMS_DIR} ${LIBRARY_DIR} ${LIBRARY_DIR}/common ${PZSTD_DIR})
|
include_directories(${PROGRAMS_DIR} ${LIBRARY_DIR} ${LIBRARY_DIR}/common ${PZSTD_DIR})
|
||||||
|
|
||||||
add_executable(pzstd ${PROGRAMS_DIR}/util.c ${PZSTD_DIR}/main.cpp ${PZSTD_DIR}/Options.cpp ${PZSTD_DIR}/Pzstd.cpp ${PZSTD_DIR}/SkippableFrame.cpp)
|
add_executable(pzstd ${PROGRAMS_DIR}/util.c ${PZSTD_DIR}/main.cpp ${PZSTD_DIR}/Options.cpp ${PZSTD_DIR}/Pzstd.cpp ${PZSTD_DIR}/SkippableFrame.cpp)
|
||||||
|
target_compile_features(pzstd PRIVATE cxx_std_11)
|
||||||
set_property(TARGET pzstd APPEND PROPERTY COMPILE_DEFINITIONS "NDEBUG")
|
set_property(TARGET pzstd APPEND PROPERTY COMPILE_DEFINITIONS "NDEBUG")
|
||||||
set_property(TARGET pzstd APPEND PROPERTY COMPILE_OPTIONS "-Wno-shadow")
|
set_property(TARGET pzstd APPEND PROPERTY COMPILE_OPTIONS "-Wno-shadow")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user