Merge pull request #2411 from terrelln/cmake-fixes

[cmake] Fix source directory with spaces
This commit is contained in:
Nick Terrell
2020-12-10 16:14:34 -08:00
committed by GitHub
5 changed files with 14 additions and 8 deletions
+5 -1
View File
@@ -89,7 +89,11 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: cmake build and test check - name: cmake build and test check
run: make cmakebuild run: |
FUZZERTEST=-T1mn ZSTREAM_TESTTIME=-T1mn make cmakebuild
cp -r ./ "../zstd source"
cd "../zstd source"
FUZZERTEST=-T1mn ZSTREAM_TESTTIME=-T1mn make cmakebuild
gcc-8-asan-ubsan-fuzz: gcc-8-asan-ubsan-fuzz:
runs-on: ubuntu-latest runs-on: ubuntu-latest
+2
View File
@@ -162,6 +162,8 @@
- if [%TEST%]==[cmake] ( - if [%TEST%]==[cmake] (
mkdir build\cmake\build && mkdir build\cmake\build &&
cd build\cmake\build && cd build\cmake\build &&
SET FUZZERTEST=-T2mn &&
SET ZSTREAM_TESTTIME=-T2mn &&
cmake -G "Visual Studio 14 2015 Win64" .. && cmake -G "Visual Studio 14 2015 Win64" .. &&
cd ..\..\.. && cd ..\..\.. &&
make clean make clean
+2 -2
View File
@@ -157,14 +157,14 @@ if (UNIX OR MINGW)
add_custom_target(libzstd.pc ALL add_custom_target(libzstd.pc ALL
${CMAKE_COMMAND} ${CMAKE_COMMAND}
-DIN="${LIBRARY_DIR}/libzstd.pc.in" -DIN=${LIBRARY_DIR}/libzstd.pc.in
-DOUT="libzstd.pc" -DOUT="libzstd.pc"
-DPREFIX="${PREFIX}" -DPREFIX="${PREFIX}"
-DEXEC_PREFIX="${EXEC_PREFIX}" -DEXEC_PREFIX="${EXEC_PREFIX}"
-DINCLUDEDIR="${INCLUDEDIR_PREFIX}${INCLUDEDIR_SUFFIX}" -DINCLUDEDIR="${INCLUDEDIR_PREFIX}${INCLUDEDIR_SUFFIX}"
-DLIBDIR="${LIBDIR_PREFIX}${LIBDIR_SUFFIX}" -DLIBDIR="${LIBDIR_PREFIX}${LIBDIR_SUFFIX}"
-DVERSION="${VERSION}" -DVERSION="${VERSION}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig.cmake" -P ${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig.cmake
COMMENT "Creating pkg-config file") COMMENT "Creating pkg-config file")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libzstd.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libzstd.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+2 -2
View File
@@ -84,9 +84,9 @@ add_test(NAME zstreamtest COMMAND zstreamtest ${ZSTD_ZSTREAM_FLAGS})
# #
# playTests.sh # playTests.sh
# #
AddTestFlagsOption(ZSTD_PLAYTESTS_FLAGS "--test-large-data" AddTestFlagsOption(ZSTD_PLAYTESTS_FLAGS "$ENV{PLAYTESTS_FLAGS}"
"Semicolon-separated list of flags to pass to the playTests.sh test") "Semicolon-separated list of flags to pass to the playTests.sh test")
add_test(NAME playTests COMMAND sh -c "${TESTS_DIR}/playTests.sh" ${ZSTD_PLAYTESTS_FLAGS}) add_test(NAME playTests COMMAND sh -c "\"${TESTS_DIR}/playTests.sh\" ${ZSTD_PLAYTESTS_FLAGS}")
if (ZSTD_BUILD_PROGRAMS) if (ZSTD_BUILD_PROGRAMS)
set_property(TEST playTests APPEND PROPERTY ENVIRONMENT set_property(TEST playTests APPEND PROPERTY ENVIRONMENT
"ZSTD_BIN=$<TARGET_FILE:zstd>" "ZSTD_BIN=$<TARGET_FILE:zstd>"
+3 -3
View File
@@ -273,10 +273,10 @@ ln -sf "$ZSTD_BIN" zstdcat
rm -f tmp_grep rm -f tmp_grep
echo "1234" > tmp_grep echo "1234" > tmp_grep
zstd -f tmp_grep zstd -f tmp_grep
lines=$(ZCAT=./zstdcat $ZSTDGREP 2>&1 "1234" tmp_grep tmp_grep.zst | wc -l) lines=$(ZCAT=./zstdcat "$ZSTDGREP" 2>&1 "1234" tmp_grep tmp_grep.zst | wc -l)
test 2 -eq $lines test 2 -eq $lines
ZCAT=./zstdcat $ZSTDGREP 2>&1 "1234" tmp_grep_bad.zst && die "Should have failed" ZCAT=./zstdcat "$ZSTDGREP" 2>&1 "1234" tmp_grep_bad.zst && die "Should have failed"
ZCAT=./zstdcat $ZSTDGREP 2>&1 "1234" tmp_grep_bad.zst | grep "No such file or directory" || true ZCAT=./zstdcat "$ZSTDGREP" 2>&1 "1234" tmp_grep_bad.zst | grep "No such file or directory" || true
rm -f tmp_grep* rm -f tmp_grep*
println "\n===> --exclude-compressed flag" println "\n===> --exclude-compressed flag"