1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-29 11:21:22 +03:00
Commit Graph

210 Commits

Author SHA1 Message Date
a0b09d0ff7 build(cmake): improve pkg-config generation
With this patch the pkg-config generation when using the CMake build
system is improved in the following ways:

- Libs.private is now filled when needed
- The JoinPaths module is now used to join paths, leading to simpler
  code
- The .pc file is always generated, regardless of the platform, as it
  can also be consumed on Windows

Here's how the .pc file is affected by these changes, in comparison to
the one generated with the official Makefiles:

    $ diff -s lib/libzstd.pc build/cmake/build-old/lib/libzstd.pc
    15c15
    < Libs.private: -pthread
    ---
    > Libs.private:

    $ diff -s lib/libzstd.pc build/cmake/build-new/lib/libzstd.pc
    Files lib/libzstd.pc and build/cmake/build-new/lib/libzstd.pc are
    identical
2022-08-28 13:24:30 +02:00
cd9d0a7e6e Fix ZSTD_BUILD_TESTS=ON build with MSVC
Fixes:

    Command line error D8021 : invalid numeric argument '/Wno-deprecated-declarations'
2022-06-30 13:20:42 -04:00
eceecc5b2c removed explicit compilation standard from cmake script
it's not expected to be useful
and can actually lead to subtle side effects
such as #3163.
2022-06-19 14:52:32 -07:00
b772f53952 Typo and grammar fixes 2022-03-12 08:58:04 +01:00
03bba1b0bf build:cmake: enable ZSTD legacy support by default 2022-03-01 18:29:47 +01:00
317bd108fe Select legacy level for cmake 2022-02-04 14:24:58 +03:00
70df5de1b2 AsyncIO compression part 1 - refactor of existing asyncio code (#3021)
* Refactored fileio.c:
- Extracted asyncio code to fileio_asyncio.c/.h
- Moved type definitions to fileio_types.h
- Moved common macro definitions needed by both fileio.c and fileio_asyncio.c to fileio_common.h

* Bugfix - rename fileio_asycio to fileio_asyncio

* Added copyrights & license to new files

* CR fixes
2022-01-24 14:43:02 -08:00
df5ad5a0f1 Add a compile option to explicitely disable assembly 2022-01-05 20:38:00 -05:00
148ff15774 Fixup MSVC source file inclusion for cmake builds 2021-12-27 02:21:21 -05:00
14a0eaf73b Fix zstd-static output name with MINGW/Clang 2021-12-22 10:16:41 +01:00
4a82bc9d00 Disable Multithreading in CMake Builds for Android 2021-12-02 17:23:42 -05:00
0a36c104ca Update CMakeLists.txt
Prevents multiple rules error when building with ninja and clang under windows
2021-11-24 11:35:36 +01:00
abc1a91fe2 add missing BUNDLE DESTINATION
fixes build on iOS
2021-09-29 08:27:12 +02:00
8bf699aa59 [build] Add support for ASM files in Make + CMake
* Extract out common portion of `lib/Makefile` into `lib/libzstd.mk`.
  Most relevantly, the way we find library files.
* Use `lib/libzstd.mk` in the other Makefiles instead of repeating the
  same code.
* Add a test `tests/test-variants.sh` that checks that the builds of
  `make -C programs allVariants` are correct, and run it in Actions.
* Adds support for ASM files in the CMake build.

The Meson build is not updated because it lists every file in zstd,
and supports ASM off the bat, so the Huffman ASM commit will just add
the ASM file to the list.

The Visual Studios build is not updated because I'm not adding ASM
support to Visual Studios yet.
2021-09-17 14:13:53 -07:00
e1f85dbca3 pzstd: fix linking for static builds 2021-07-09 13:21:15 -07:00
sen
06718087f8 Remove deprecate flag for vcx (#2647) 2021-05-13 19:33:48 -04:00
ee65162655 Merge branch 'dev' into fasterCygwin 2021-05-06 16:06:00 -07:00
sen
698f261b35 [1.5.0] Deprecate some functions (#2582)
* Add deprecated macro to zstd.h, mark certain functions as deprecated

* Remove ZSTD_compress.c dependencies on deprecated functions
2021-05-06 17:59:32 -04:00
e7e4b74b2b Merge pull request #2600 from nickhutchinson/clang-cl
Fix for excessive compiler warnings when building with clang-cl
2021-05-06 12:43:15 -07:00
2d34062836 CMake: fix excessive build warnings when building with clang-cl 2021-05-06 18:46:37 +01:00
2e76bd7d10 attempt to make Appveyor's Cygwin test faster
Cygwin is the longest Appveyor test
Appveyor is typically the CI which finish last
2021-05-06 08:47:45 -07:00
09149beaf8 [1.5.0] Move zstd_errors.h and zdict.h to lib/ root
`zstd_errors.h` and `zdict.h` are public headers, so they deserve to be
in the root `lib/` directory with `zstd.h`, not mixed in with our private
headers.
2021-04-30 15:13:54 -07:00
a423305e7b Remove ZBUFF tests 2021-04-19 17:27:05 -04:00
2636f53619 CMake: Enable only C for lib and programs projects 2021-02-07 19:39:04 -05:00
54a4998a80 Add basic tracing functionality 2021-02-05 16:28:52 -08:00
0766540b59 cmake: use configure_file() for creating the .pc file
Escaping in add_custom_target() seems to depend on the shell used in the cmake
generator and using Ninja on Windows, which uses cmd.exe, results in stray backslashes
in the .pc file.

Instead of going through escaping hell just use configure_file() with the existing
libzstd.pc.in file already used by the simple Makefile based build system.

This fixes the .pc file syntax when building zstd with CMake+Ninja+gcc on Windows.
2021-01-09 09:29:16 +01:00
bc3cda9b9f [CI][cmake] Disable --test-large-data and shorten fuzzing time to 2 mins 2020-12-10 13:33:34 -08:00
54105f5757 [cmake] Quote environment variables for tests
Fix the quoting for the invocation of `playtests.sh`.
2020-12-10 11:03:47 -08:00
ef5d15b719 [cmake] Fix pkgconfig quoting
The pkgconfig file generation didn't correctly escape the paths. It both
quoted and escaped spaces with `\`, which doesn't work. The fix is to
remove the quoting.
2020-12-10 11:03:45 -08:00
a75f9ce3e9 Apply Same Strategy to CMake 2020-12-08 20:46:37 -05:00
db249bef4b Allow paramgrill in cmake on windows 2020-12-03 10:39:16 -05:00
19e773a5d6 Update cmake_minimum_required to 2.8.12
Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-11-24 12:05:42 -08:00
865ecf67ae Merge pull request #2183 from tonytheodore/patch-1
Install pkg-config file on MINGW also
2020-07-10 01:20:59 -07:00
0fa9406ae2 removing deduplicatin of flags 2020-06-15 14:58:53 -07:00
e75db971fc DLL install fix for https://github.com/facebook/zstd/issues/2160
Credit goes to @xantares

Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
2020-06-02 07:45:06 -07:00
53fe73a720 Install pkg-config file on MINGW also
Mingw follows unix conventions and often expects pkg-config files to be present.
2020-06-02 18:18:40 +10:00
082755bd3f do not install zbuff.h
this API is deprecated, for a loong time now,
all related symbols will be removed in a future version (likely v1.5.0)
and the header file `zbuff.h` doesn't compile from `include/` anyway,
because it needs to be positioned one directory below `zstd.h`.

Also removed `cover.h` from `cmake` installer,
as it should have never been part of this list to begin with.
2020-05-22 15:35:54 -07:00
15561bcf74 Fix pkg-config File Generation Again Again
Resubmission of #2001. This switches the `sed` invocations to use `-E`,
extended regex syntax, which is better standardized across platforms.
I guess.

Same test plan:

```
make -C lib clean libzstd.pc
cat lib/libzstd.pc

echo # should fail
make -C lib clean libzstd.pc     LIBDIR=/foo
make -C lib clean libzstd.pc INCLUDEDIR=/foo
make -C lib clean libzstd.pc     LIBDIR=/usr/localfoo
make -C lib clean libzstd.pc INCLUDEDIR=/usr/localfoo
make -C lib clean libzstd.pc     LIBDIR=/usr/local/lib     prefix=/foo
make -C lib clean libzstd.pc INCLUDEDIR=/usr/local/include prefix=/foo

echo # should succeed
make -C lib clean libzstd.pc     LIBDIR=/usr/local/foo
make -C lib clean libzstd.pc INCLUDEDIR=/usr/local/foo
make -C lib clean libzstd.pc     LIBDIR=/usr/local/
make -C lib clean libzstd.pc INCLUDEDIR=/usr/local/
make -C lib clean libzstd.pc     LIBDIR=/usr/local
make -C lib clean libzstd.pc INCLUDEDIR=/usr/local
make -C lib clean libzstd.pc     LIBDIR=/tmp/foo prefix=/tmp
make -C lib clean libzstd.pc INCLUDEDIR=/tmp/foo prefix=/tmp
make -C lib clean libzstd.pc     LIBDIR=/tmp/foo prefix=/tmp/foo
make -C lib clean libzstd.pc INCLUDEDIR=/tmp/foo prefix=/tmp/foo

echo # should also succeed
make -C lib clean libzstd.pc prefix=/foo LIBDIR=/foo/bar INCLUDEDIR=/foo/
cat lib/libzstd.pc

mkdir out
cd out
cmake ../build/cmake
make
cat lib/libzstd.pc
```
2020-05-08 16:11:32 -04:00
a036f60255 Merge pull request #2078 from nocnokneo/fix-destdir-installs
CMake: Fix DESTDIR installs and the Package Config file
2020-05-08 16:09:44 -04:00
4f755bdafc faster cygwin test
The cygwin test on Appveyor is way too long (>30 mn).
The main issue is the very long zstreamtest, because no time out has been programmed.
Ensures that both fuzzer and zstreamtest receive a 30sec slot.
Should reduce cygwin tests duration by -30mn.
2020-05-05 14:08:35 -07:00
105d9b62ae Minor CMake refactoring/simplification 2020-04-09 17:16:12 -04:00
b674a1eec3 Fix that installation of the libzstd.pc does not respect DESTDIR installations 2020-04-09 17:16:12 -04:00
c22551b903 Generate a better CMake Package Config file 2020-04-09 17:16:12 -04:00
5b054d9e90 Add support for running more tests via CTest 2020-03-30 15:14:00 -04:00
496d8c8b77 Respect the conventional BUILD_TESTS CMake option on the first configure 2020-03-23 17:49:04 -04:00
b669c5347a Revert "Fix pkg-config File Generation Again" (#2016) 2020-02-26 10:52:49 -08:00
e668c9b528 Fix pkg-config File Generation Again
Revises #1851. Fixes #1900. Replaces #1930.

Thanks to @orbea, @neheb, @Polynomial-C, and particularly @eli-schwartz for
pointing out the problem and suggesting solutions.

Tested with

  ```
  make -C lib clean libzstd.pc
  cat lib/libzstd.pc

  # should fail
  make -C lib clean libzstd.pc     LIBDIR=/foo
  make -C lib clean libzstd.pc INCLUDEDIR=/foo
  make -C lib clean libzstd.pc     LIBDIR=/usr/localfoo
  make -C lib clean libzstd.pc INCLUDEDIR=/usr/localfoo
  make -C lib clean libzstd.pc     LIBDIR=/usr/local/lib     prefix=/foo
  make -C lib clean libzstd.pc INCLUDEDIR=/usr/local/include prefix=/foo

  # should succeed
  make -C lib clean libzstd.pc     LIBDIR=/usr/local/foo
  make -C lib clean libzstd.pc INCLUDEDIR=/usr/local/foo
  make -C lib clean libzstd.pc     LIBDIR=/usr/local/
  make -C lib clean libzstd.pc INCLUDEDIR=/usr/local/
  make -C lib clean libzstd.pc     LIBDIR=/usr/local
  make -C lib clean libzstd.pc INCLUDEDIR=/usr/local
  make -C lib clean libzstd.pc     LIBDIR=/tmp/foo prefix=/tmp
  make -C lib clean libzstd.pc INCLUDEDIR=/tmp/foo prefix=/tmp
  make -C lib clean libzstd.pc     LIBDIR=/tmp/foo prefix=/tmp/foo
  make -C lib clean libzstd.pc INCLUDEDIR=/tmp/foo prefix=/tmp/foo

  # should also succeed
  make -C lib clean libzstd.pc prefix=/foo LIBDIR=/foo/bar INCLUDEDIR=/foo/
  cat lib/libzstd.pc

  mkdir out
  cd out
  cmake ../build/cmake
  make
  cat lib/libzstd.pc
  ```
2020-02-18 12:23:50 -05:00
3ed0f65158 [cmake] Add playTests.sh as a test 2020-01-13 14:16:15 -08:00
23e997439a Make idiomatic cmake install so third party cmake installers work right. 2019-12-06 17:18:54 +00:00
ac992b35a2 [cmake][tests] Add zstreamtest executable 2019-11-20 17:26:06 -08:00