1
0
mirror of https://github.com/facebook/zstd.git synced 2025-03-06 16:56:49 +02:00

397 Commits

Author SHA1 Message Date
Yann Collet
47edd0acf4 removed fullbench-dll project from visual solutions 2024-12-20 10:37:00 -08:00
Yann Collet
6f8c1046d0 update Visual Studio solutions 2024-12-20 10:37:00 -08:00
Yann Collet
2503b64345 fix minor artifact error in single_file_lib 2024-12-20 10:36:58 -08:00
Yann Collet
b4a40a845f move Sequences definition to zstd_compress_internal.h
they should not be in common/zstd_internal.h,
since these definitions are not shared beyond lib/compress/.
2024-12-20 10:36:55 -08:00
Victor Zhang
1198a582d3 Update VERSION_LESS usage to VERSION_GREATER_THAN 2024-12-12 11:39:40 -08:00
Victor Zhang
e190e7944e Update cmake minimum requirement to 3.10
CMake warns on the current minimum requirement (3.5). Update to 3.10.
This means support is still available for the default on Ubuntu 18.04, which
exited LTS standard in April of 2023.
[draft]
2024-12-09 10:53:38 -08:00
Yann Collet
adbb536d00 fixed single file library test
copy "zstd_errors.h" alongside "zstd.h" to pass compilation test.
2024-10-31 14:38:36 -07:00
Yann Collet
76ad1d6903 fixed VS2010 solution 2024-10-23 11:50:56 -07:00
Yann Collet
6939235f01 fixed meson build 2024-10-23 11:50:56 -07:00
Yann Collet
dd38c677eb fixed single-library build 2024-10-23 11:50:56 -07:00
Artem Labazov
ccc02a9a77 meson: Fix contrib and tests build 2024-09-30 18:05:57 +03:00
Artem Labazov
d2d49a1161 meson: Do not export private headers in libzstd_dep to avoid name clash
This way libzstd_dep does not override, for instance, <xxhash.h>
2024-09-30 17:03:42 +03:00
Dimitri Papadopoulos
44e83e9180
Fix typos not found by codespell 2024-06-20 20:16:25 +02:00
Yann Collet
1232d4c45d
Merge pull request #3931 from bgilbert/pthread
meson: don't add `-pthread` to static linking flags on Windows
2024-04-20 20:25:19 -07:00
Benjamin Gilbert
5be2a8721d meson: don't add -pthread to static linking flags on Windows
Meson always returns -pthread in dependency('threads') on non-MSVC
compilers.  On Windows we use Windows threading primitives, so we don't
need this.  Avoid adding -pthread to libzstd's link flags, either as a
Meson subproject or via pkg-config Libs.private, so the application
doesn't inadvertently depend on winpthreads.

Add a Meson MinGW cross-compile CI test that checks for this.  It turns
out that pzstd fails to build in that environment, so have the test
skip building contrib for now.
2024-04-11 01:27:24 +09:00
BadWolf
fd5f8106a5 fix missing include folder for resource compiler 2024-04-06 00:05:58 +02:00
ManuelBlanc
9c442d6fc2 Improve MSBuild search; add latest option 2024-03-23 18:34:07 -04:00
ManuelBlanc
65ab6c267e Use vswhere to find MSBuild; add VS2022 support
See:
https://github.com/microsoft/vswhere/wiki/Find-MSBuild
2024-03-23 09:13:49 -04:00
Nick Terrell
42b02f5185 [cmake] Emit warnings for contradictory build settings
Document that the `ZSTD_BUILD_{SHARED,STATIC}` take precedence over `BUILD_SHARED_LIBS` when exactly one is ON.

Thanks to @teo-tsirpanis for pointing out the potentially confusing behavior.
2024-03-18 09:31:22 -07:00
Nick Terrell
a595e5812a [cmake] Fix up PR #3716
* Make a variable `PublicHeaders` for Zstd's public headers
* Add `PublicHeaders` to `Headers`, which was missing
* Only export `${LIBRARY_DIR}` publicly, not `common/`
* Switch the `target_include_directories()` to `INTERFACE` because zstd uses relative includes internally, so doesn't need any include directories to build
* Switch installation to use the `PublicHeaders` variable, and test that the right headers are installed
2024-03-18 09:18:51 -04:00
dsvi
79cd0ff712 Makes it possible to use the lib through FetchContent or ExternalProject_Add 2024-03-18 09:18:51 -04:00
Nick Terrell
a0a9bc6c95 [cmake] Always create libzstd target
If both `ZSTD_BUILD_SHARED` and `ZSTD_BUILD_STATIC` are set, then cmake exports the libraries `libzstd_shared` and `libzstd_static` only.
It does not export `libzstd`, which is only exported when exactly one of `ZSTD_BUILD_SHARED` and `ZSTD_BUILD_STATIC` is set.
This PR exports `libzstd` in that case, based on the value of the standard CMake variable [`BUILD_SHARED_LIBS`](https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html).
This ensures that `libzstd` can always be used to refer to the exported zstd library, since the build errors if neither `ZSTD_BUILD_SHARED` nor `ZSTD_BUILD_STATIC` are set.

I tested all the possible combinations of `ZSTD_BUILD_SHARED`, `ZSTD_BUILD_STATIC`, and `BUILD_SHARED_LIBS` and they always worked as expected:
* If only exactly one of `ZSTD_BUILD_SHARED` and `ZSTD_BUILD_STATIC` is set, that is used as `libzstd`.
* Otherwise, libzstd is set based on `BUILD_SHARED_LIBS`.

Fixes #3859.
2024-03-14 15:04:46 -04:00
Nick Terrell
c1e995321e [CI] Run tests with CMake on Windows
Build and run tests on Windows with CMake
2024-03-13 09:45:40 -04:00
Yann Collet
f6039f3d5f cmake refactor: move HP-UX specific logic into its own function
reduce visual clutter of corner case configuration.
2024-03-11 16:22:13 -07:00
Yann Collet
a4db145900
Merge pull request #3862 from likema/fix-hpux-parisc
Fix building on HP-UX 11.11 PA-RISC
2024-03-11 15:55:58 -07:00
Theodore Tsirpanis
b27d1634a5 Merge branch 'dev' into unified-target 2024-02-28 01:25:15 +02:00
Theodore Tsirpanis
dcd713ce06 Define the unified target inside the CMake project, and export it.
This is less error-prone.
2024-02-27 23:39:59 +02:00
Yann Collet
9e711c9360 fix Visual Studio datagen recipe 2024-02-20 22:59:58 -08:00
Yann Collet
b34517a440 fix cmake build 2024-02-20 20:20:40 -08:00
Yann Collet
c2d3570338 fix meson datagen build 2024-02-20 18:17:28 -08:00
Yann Collet
fd03971252 blindfix meson recipe
note: absence of GLOB capability within meson makes its maintenance more painful.
2024-01-29 15:50:21 -08:00
Yann Collet
befcec1788 fix cmake recipe 2024-01-29 15:45:16 -08:00
Yann Collet
3ce4c6e046 fix Visual Studio solutions
note: we probably don't want to maintain VS2008 solution anymore.
Its successor VS2010 is > 10 years old,
which is more or less the limit after which we can stop supporting old compilers.
2024-01-29 15:24:42 -08:00
Yann Collet
2fc7248412 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)
2024-01-27 17:30:06 -08:00
Yann Collet
dcf784a04b
Merge pull request #3760 from jcelerier/patch-1
[x-compile] Fix cross-compiling for AArch64 with lld
2024-01-13 11:41:30 -08:00
Like Ma
e49d1ab6aa Fix building on HP-UX 11.11 PA-RISC
By CMake 3.8.2 and GCC 4.7.1
2024-01-14 00:32:19 +08:00
Theodore Tsirpanis
475da4fb2e Make zstd::libzstd an imported interface target.
It cannot be an alias, because it would lock the package to use either static or shared libraries at its build time. We want to decide this at the time `find_package` is called.
2023-12-19 17:04:09 +02:00
Theodore Tsirpanis
c53d650d9a Export a zstd::libzstd target if only static or dynamic linkage is specified. 2023-11-07 15:54:19 +02:00
Christoph Grüninger
f013b1b504 [cmake] Remove code for compatibility with CMake < 3.0
The required version of CMake is now 3.5.
2023-11-01 20:46:47 +01:00
Christoph Grüninger
4502ca5f42 [cmake] Require CMake version 3.5 or newer
More recent versions of CMake emit the following warning:
CMake Deprecation Warning at cmake/CMakeLists.txt:10 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
2023-10-31 23:30:43 +01:00
Xavier Mitault
3c3845b9d8
Add target_include_directories because windows and macos need it for me 2023-10-23 17:38:09 +02:00
Xavier Mitault
e590c8a0e3
Add doc on how to use it with cmake FetchContent 2023-10-18 13:22:15 +02:00
Yann Collet
4f77b81c8a Merge pull request #3777 from facebook/fix_x32
fix x32 tests on Github CI
2023-10-06 08:05:29 -04:00
Dimitri Papadopoulos
fe34776c20
Fix new typos found by codespell 2023-09-23 18:56:01 +02:00
Johan Mabille
253873220f Fixed zstd cmake shared build on windows 2023-08-27 16:51:24 +02:00
Mustafa UZUN
a02d81f944 fix: ZSTD_BUILD_DECOMPRESSION message 2023-08-19 15:44:53 +03:00
Gregor Jasny
7e09f07b32 Fix Intel Xcode builds with assembly
When forcing the source file language to `C`, Xcode enforces
the file to be compiled as `C` by appending `-x c` to the
compiler command line.

For now try to limit the damage and only enforce the language
if the ASM and C compilers differ.

Reproducer (CMake `3.26.4`, Xcode `14.3`):
```
cmake -S build/cmake -B _b -GXcode -DCMAKE_OSX_ARCHITECTURES=x86_64
cmake --build _b
```

Fix: #3622
2023-06-02 12:43:59 +02:00
Tao He
5059618295 Add options in Makefile to cmake
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-05-26 13:45:21 -07:00
Tobias Hieta
979b047114 Disable linker flag detection on MSVC/ClangCL.
This fixes compilation with clang-cl on Windows. There
is a bug in cmake so that check_linker_flag() doesn't give
the correct result when using link.exe/lld-link.exe.

Details in CMake's gitlab: https://gitlab.kitware.com/cmake/cmake/-/issues/22023

Fixes #3522
2023-03-22 22:13:57 +01:00
Yann Collet
4ebaf36582
Merge pull request #3490 from eli-schwartz/meson-tests-noprograms
meson: always build the zstd binary when tests are enabled
2023-02-16 11:27:27 -08:00