79 Commits

Author SHA1 Message Date
Yann Collet
7887022e5d Merge pull request #1510 from ds-sloth/respect-global-pic
CMakeLists.txt: respect global CMAKE_POSITION_INDEPENDENT_CODE flag
2024-11-05 10:59:46 -08:00
Yann Collet
c612292343 Merge pull request #1524 from bgilbert/freestanding
build/meson: force `LZ4_DEBUG=0` for `tests/freestanding`
2024-10-06 14:37:03 -07:00
Benjamin Gilbert
b8f1cc1f07 build/meson: force LZ4_DEBUG=0 for tests/freestanding
Match the Makefile, which never sets LZ4_DEBUG for this test.  If
LZ4_DEBUG is non-zero, lib/lz4.c #includes <assert.h>, the musl version of
which has a conflicting definition for __assert_fail:

    https://www.openwall.com/lists/musl/2019/03/04/6

Fixes build failure:

    ../../../tests/freestanding.c:173:6: error: conflicting types for '__assert_fail'; have 'void(const char *, const char *, unsigned int,  const char *)'
      173 | void __assert_fail(const char * assertion, const char * file, unsigned int line, const char * function) {
          |      ^~~~~~~~~~~~~
    In file included from ../../../tests/../lib/lz4.c:270,
                     from ../../../tests/freestanding.c:49:
    /usr/include/assert.h:19:16: note: previous declaration of '__assert_fail' with type 'void(const char *, const char *, int,  const char *)'
       19 | _Noreturn void __assert_fail (const char *, const char *, int, const char *);
          |                ^~~~~~~~~~~~~
2024-10-06 04:11:36 -07:00
Benjamin Gilbert
6d17921245 build/meson: avoid passing long options to ln
On macOS, ln only supports short options.
2024-10-06 03:18:27 -07:00
Benjamin Gilbert
ac3e03c55c build/meson: update directory path in README 2024-10-06 03:15:38 -07:00
ds-sloth
0e44420380 CMakeLists.txt: use CMAKE_POSITION_INDEPENDENT_CODE to set default only 2024-09-16 19:21:35 -04:00
ds-sloth
80d4c6215a CMakeLists.txt: respect global CMAKE_POSITION_INDEPENDENT_CODE flag 2024-09-11 21:37:35 -04:00
Yann Collet
45fda541f0 Merge pull request #1485 from grobian/meson-no-stdc99
meson: do not force c99 mode
2024-08-03 23:05:47 -07:00
Yann Collet
3d946c68aa Merge pull request #1479 from heitbaum/cmake
add back lz4c target but default to OFF
2024-07-30 13:10:42 -07:00
Fabian Groffen
bce6a94c25 meson: do not force c99 mode
On Solaris/OpenIndiana hosts forcing (old) C99 means disabling POSIX
2001 functionality, resulting in errors like

In file included from ../../../net/ptah/export/gentoo/working-repos/lz4/programs/bench.c:39:
../../../net/ptah/export/gentoo/working-repos/lz4/programs/util.h: In function  UTIL_getOpenFileSize’:
../../../net/ptah/export/gentoo/working-repos/lz4/programs/util.h:156:23: error: implicit declaration of function ‘fileno’ [-Wimplicit-function-declaration]
  156 | #  define UTIL_fileno fileno
      |                       ^~~~~~
../../../net/ptah/export/gentoo/working-repos/lz4/programs/util.h:325:10: note: in expansion of macro ‘UTIL_fileno’
  325 |     fd = UTIL_fileno(file);
      |          ^~~~~~~~~~~

These can be fixed either by forcing a standard to be applied in programs/platform.h or by not forcing the compiler to use an old standard.

Since CMake and Makefile don't force C99 by default either, just drop it from
meson.build.

Signed-off-by: Fabian Groffen <grobian@gentoo.org>
2024-07-30 21:50:06 +02:00
Yann Collet
fe399506bd Merge pull request #1469 from hhoffstaette/no-sp
Fix building freestanding test with clang & enabled stack protector
2024-07-28 21:32:24 -07:00
Rudi Heitbaum
6969661757 add back lz4c target but default to OFF
Partially revert "removed lz4c target"
This reverts commit 65998fecaf.
2024-07-28 01:26:49 +00:00
Kai Pastor
ca197e67a0 Add an lz4::lz4 target to the exported package 2024-07-23 20:32:43 +02:00
Holger Hoffstätte
d08826c4fd Fix building freestanding test with clang & enabled stack protector
The freestanding test is special as it requires reimplementation of
runtime/toolchain functionality. When building with clang where the
compiler is configured to enable the stack-protector by default,
building fails due to missing __stack_chk_fail symbols.
Thefore disable stack protection specifically for this test.
2024-07-23 13:36:41 +02:00
Yann Collet
65998fecaf removed lz4c target
should no longer be necessary
2024-07-20 17:26:32 -07:00
Yann Collet
4cc04310c9 remove Visual Solutions
keep VS2022 for the time being,
as several tests still depend on its presence
2024-07-15 16:57:17 -07:00
Yann Collet
b20025fd03 minor readability refactor for version extraction logic 2024-07-12 21:21:44 -07:00
Yann Collet
f76c979f84 add lz4file.h to include list 2024-07-12 21:11:10 -07:00
Yann Collet
e5563ea26c update logic that determines LZ4_BUNDLED_MODE
smaller and hopefully clearer
2024-07-12 19:46:44 -07:00
Yann Collet
6ce6e6da6f improved logic to extract version number 2024-07-12 18:06:13 -07:00
Yann Collet
b5139c79d6 do not test gcc/clang flags when building for visual
also: additional warning flags are for debug builds
2024-07-12 08:30:54 -07:00
Yann Collet
75391bdfd6 added test for script generating solution on GH
and test resulting compilation in debug mode

and removed visual x64 debug test from appveyor, since it's run from Github Actions,
this will make appveyor a bit faster, and it's the slower test.
2024-07-11 22:04:50 -07:00
Yann Collet
d2f2e186cc fixed VS2017 build script 2024-07-11 17:09:03 -07:00
Yann Collet
fae5a66b09 provided scripts for other versions of Visual (2015+)
also: automatically detects `cmake` path,
and allows user to override automatic detection.
2024-07-11 17:02:23 -07:00
Yann Collet
c292e7dab9 test some scripts to generate visual solutions on Windows 2024-07-11 16:09:50 -07:00
Yann Collet
7ec8526d76 build: minor: fix lz4 project in VS2017 solution 2024-07-07 00:09:36 +02:00
Theodore Tsirpanis
6aedc2362a [cmake] Always create lz4 target.
See facebook/zstd#3965.
2024-05-18 18:16:46 +03:00
Yann Collet
bdc8e14e5a [cmake]: just a minor refactor of the symlink installation paragraph
for improved readability.
2024-05-09 16:52:28 -07:00
ur4t
ba744bd16c CMake: Separate symlinks creation and installation 2024-04-28 17:25:41 +08:00
Andreas Deininger
56e80abbfd Fix typo 2024-03-08 22:20:35 +01:00
Theodore Tsirpanis
e5207e0c19 Add unified CMake target if building only a shared or a statric library. 2024-02-27 21:39:48 +02:00
Razakhel
be8a4f6522 Added preprocessor checks for Clang on Windows
- MSVC-specific code is used in some places and compiled only if _MSC_VER is set; however, Clang under Windows also defines this, which reports errors on this non-standard code if the -pedantic-errors compiler flag is set
2024-02-22 13:36:12 +01:00
Yann Collet
ef7baa60d4 fixed visual studio solution
and refactor a few minor code comments
2024-01-28 15:33:12 -08:00
Yann Collet
72be51731c fixed meson build 2024-01-28 15:00:13 -08:00
Yann Collet
0bac9ab8f9 fixed visual studio projects 2024-01-28 14:24:09 -08:00
Yann Collet
5f9a5c6167 fix meson recipe 2024-01-28 12:39:07 -08:00
Yann Collet
0a1499fbc3 fixed meson formula
datagen is now in tests/
2024-01-28 10:39:42 -08:00
Yann Collet
dac61f75ab fixed Visual Studio solutions
datagen is now in tests/
2024-01-28 10:36:59 -08:00
Yann Collet
f376a90e78 fix VS2022 solution 2023-12-28 21:52:09 -08:00
Yann Collet
5fb1bd2395 fix VS2010 solution
and some minor printf limitations on Windows.
2023-12-28 21:45:03 -08:00
Yann Collet
c6762ec1c0 fixed meson build
and make it build the MT version of lz4
with an option that is enabled by default but can be disabled on demand.

Also :
- added make target mesonbuild, for easy local build
- made huge tests friendlier to MT variant, for faster testing time
2023-12-28 20:22:23 -08:00
Yann Collet
a49ca22195 fix cmake recipe
though it still builds single-threaded lz4
2023-12-28 17:14:15 -08:00
Yann Collet
26b3b238fe Merge pull request #1253 from ltrk2/bugfix/hashing-on-big-endian
Make hashes identical between LE and BE platforms
2023-12-22 17:45:25 -08:00
Yann Collet
215dac378e Merge pull request #1291 from LocalSpook/meson-whitespace
Make Meson version number parsing more robust
2023-10-13 16:27:52 -07:00
LocalSpook
b389bbf5fc Make Meson version number parsing more robust 2023-10-11 18:51:50 -07:00
LocalSpook
47daa7efdb Make CMake version number parsing more robust 2023-10-11 18:49:16 -07:00
Takayuki Matsuoka
e92efba7f7 fix: issue #1269
Since `lz4/programs/Makefile:SRCFILES` explicitly contains source code of lz4 CLI and liblz4, `CMakeLists.txt` must follow this settings.

It also means, lz4 CLI and legacy lz4c must avoid to use `liblz4`.
2023-10-08 22:34:53 +09:00
Yann Collet
fa834730d0 fixed meson build 2023-09-26 13:05:58 -07:00
Laszlo Dobcsanyi
38cc73c9c7 Move GNUInstallDirs include before its referenced first 2023-08-27 20:34:39 +02:00
ltrk2
eef01f7791 Hide the functionality behind a feature flag and document it 2023-08-15 14:13:05 -07:00