Commit Graph

195 Commits

Author SHA1 Message Date
Sai Charan Koduru
f547dca9e3 Remove ZSTD_DLL_EXPORT=1 for static lib
As a principle, static libs should not dllexport methods, that should only be used when building DLLs.

Case in point: when static libs with dllexport directives are linked into DLLs created with a .def file, the VC++ compiler exports the dllexported methods into the DLL, in addition to the exports listed in the .def file. This will result in undesired link dependencies and is not the correct thing to do.
2019-06-12 12:26:36 -07:00
lzutao
1d70bc3ba9 meson: Enable testing in CI (#1609)
* tests: Fix shellcheck warnings in playTests.sh

* tests: Do not use ../programs which is relative to tests dirs

This commit fixes error when running playTests.sh in Meson.
Mesonbuild runs out of tree, so ./datagen not in `zstd/tests` dir,
it lies in <mesonbuilddir>/tests. This leads to ../programs invalid.

* tests: Replace relative paths for zstd/tests dir

* playTests: Set shell options explicitly, not in shebang

* playTests: Replace echo -e with printf

* meson: Fix test-zstd

Use std=gnu99 to build and test just like `make test`.

* meson: Fix legacy test

* meson: Enable testing in CI

Run build under release mode for faster test time.

* meson: Increase timeout time for test-zstream
2019-05-02 12:35:37 -07:00
Lzu Tao
5d900ff747 meson: Error out if fail to extracted version number 2019-04-30 13:12:00 +07:00
Lzu Tao
4107b734bd meson: Update default project version
* Update to use ninja v1.9.0 on CI
2019-04-27 01:42:22 +07:00
Nick Terrell
82d5a9870e [visual] Compile with ZSTD_MULTITHREAD=1
This branch `appveyorTests` runs the tests that `master` runs, so
passing Appveyor means that the tests are fixed.
2019-04-15 23:04:46 -07:00
Josh Soref
a880ca239b Spelling (#1582)
* spelling: accidentally

* spelling: across

* spelling: additionally

* spelling: addresses

* spelling: appropriate

* spelling: assumed

* spelling: available

* spelling: builder

* spelling: capacity

* spelling: compiler

* spelling: compressibility

* spelling: compressor

* spelling: compression

* spelling: contract

* spelling: convenience

* spelling: decompress

* spelling: description

* spelling: deflate

* spelling: deterministically

* spelling: dictionary

* spelling: display

* spelling: eliminate

* spelling: preemptively

* spelling: exclude

* spelling: failure

* spelling: independence

* spelling: independent

* spelling: intentionally

* spelling: matching

* spelling: maximum

* spelling: meaning

* spelling: mishandled

* spelling: memory

* spelling: occasionally

* spelling: occurrence

* spelling: official

* spelling: offsets

* spelling: original

* spelling: output

* spelling: overflow

* spelling: overridden

* spelling: parameter

* spelling: performance

* spelling: probability

* spelling: receives

* spelling: redundant

* spelling: recompression

* spelling: resources

* spelling: sanity

* spelling: segment

* spelling: series

* spelling: specified

* spelling: specify

* spelling: subtracted

* spelling: successful

* spelling: return

* spelling: translation

* spelling: update

* spelling: unrelated

* spelling: useless

* spelling: variables

* spelling: variety

* spelling: verbatim

* spelling: verification

* spelling: visited

* spelling: warming

* spelling: workers

* spelling: with
2019-04-12 11:18:11 -07:00
Lzu Tao
6c9b023f3e meson: Fix build 2019-04-12 21:28:36 +07:00
Yann Collet
fbdd30d68e fixed cmake build script for test programs 2019-04-10 17:47:01 -07:00
Yann Collet
2fa4f2e246 updated Visual projects
added timefn
2019-04-10 15:07:36 -07:00
Yann Collet
2c6b14ed22 fixed Windows header
cmake build script: added timefn
2019-04-10 14:54:13 -07:00
Nehal J Wani
7ac2052dbc
[libzstd] Specify soversion and version correctly for CMake build
Fixes #1512
2019-03-23 17:37:37 +05:30
Peter (Stig) Edwards
188c748208
-Wformat-security not needed with -Wformat=2 2019-02-01 09:30:31 +00:00
Hans Johnson
62c0dd7aff ENH: Simplify conditional logic
Based on excellent comment in #1489, the logic
to set cmake policies was simplified.  This will
provide an easier mechanism for maintaining the
conditional logic across many versions of cmake.
2019-01-08 14:25:56 -06:00
Erik Webb
9448a3790d Check CMake minor version support for VERSION_LESS_EQUAL
VERSION_LESS_EQUAL is only available to CMake 3.7+. This adds additional
logic to check that CMAKE_MINOR_VERSION is at least 7.

Fixes #1489
2019-01-03 15:26:20 -05:00
Hans Johnson
97d1de3d22 Provide forward compatible cmake paradigms
Automatically extract version information
from the zstd.h file.  Use naming of variables
consisent with modern cmake and https://semver.org/
(Semantic Versioning 2.0.0, MAJOR, MINOR, PATCH)

Modern versions of cmake provide consistent
paradigms for configuring project external
interface values.

This set of changes provide a back port of
some of cmake 3+ paradigms back to cmake 2.8.9.
Set and allow use of the current cmake policies
for newer versions of cmake when available to
allow for modern compiler features to be
utilized when available.

NOTE: The intent is that future modifications to
cmake will enable (conditional on cmake version support)
the ability to support modern linkage, and target
export mechanisms.  Those future changes will
make incorporating zstd into other packages
much easier.

This patch also allows the more rigourous error
checking of commmon cmake errors to be preformed
by cmake (i.e. more stringent syntax checking and
create errors for common hard to find misuses of
cmake variables).

This patch also provides support for modern
compiler support options by cmake (like
enabling interprocedural optimization
if link time optimizations are known to be supported
by the compiler envirionment.  IPO can be supported
by setting the CMAKE_INTERPROCEDURAL_OPTIMIZATION variable
for newer versions of cmake.
2018-12-28 13:47:35 -06:00
Yann Collet
23c73fe3e2
Merge pull request #1474 from hjmjohnson/cmake-set-default-build-type
Cmake set default build type
2018-12-28 11:02:22 -08:00
Yann Collet
6746de8dd6
Merge pull request #1478 from hjmjohnson/remove-duplicates-validation
BUG: list sub-command REMOVE_DUPLICATES requires list to be present
2018-12-28 10:50:03 -08:00
Yann Collet
bad7ed161a
Merge pull request #1483 from lzutao/meson-readme
meson: Update build guide
2018-12-28 09:46:13 -08:00
Yann Collet
663c55eba0
Merge pull request #1484 from lzutao/meson-pkgconf
meson: Correct generating pkgconf after Meson v0.49.0
2018-12-27 22:39:07 -08:00
Lzu Tao
787a72cdfe meson: Correct generating pkgconf after Meson v0.49.0 2018-12-28 11:20:33 +07:00
Lzu Tao
226cdffd69 meson: Update build guide [skip ci] 2018-12-28 11:17:11 +07:00
Yann Collet
470344d33e
Merge pull request #1479 from facebook/visualTest
Fix remaining Windows errors
2018-12-27 04:42:44 -08:00
Hans Johnson
1a279ae85a BUG: list sub-command REMOVE_DUPLICATES requires list to be present
When compiling without c++ enabled, some variables are not present.
This is a check enforced in recent Cmake versions.

CMake Error at CMakeModules/AddZstdCompilationFlags.cmake:54 (list):
  list sub-command REMOVE_DUPLICATES requires list to be present.
Call Stack (most recent call first):
  CMakeLists.txt:53 (ADD_ZSTD_COMPILATION_FLAGS)
2018-12-26 13:26:59 -06:00
Hans Johnson
77ef7847f7 Improve setting the default build type
The CMAKE_BUILD_TYPE variable is a CACHE variable
and should be set in a way that persists and is
documented in the CACHE.  Also set the default
values for the gui to ease selection of types.

These changes provide better support for GUI
configurators that support cmake.
2018-12-26 13:23:21 -06:00
Hans Johnson
304df8b883 ENH: Update to -DZSTD_LEGACY_SUPPORT=5 2018-12-26 13:18:39 -06:00
Yann Collet
1fdba696ca fixed VS2008 project
bench.c => benchfn.c + benchzstd.c
wrong util.c from prior patch

and warnings :
C4127
2018-12-25 16:14:14 -08:00
Hans Johnson
443b5c40e4 DOC: Provide documentation for cmake best practices. 2018-12-24 07:06:31 -06:00
Hans Johnson
d3fc848ddd STYLE: Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the block.
This is no longer the preferred style.
2018-12-22 19:32:39 -06:00
Hans Johnson
2f1ff84119 STYLE: Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands.  Later command names
became case-insensitive.  Now the preferred style is lower-case.
2018-12-22 19:32:39 -06:00
Yann Collet
5bdbd997ae
Merge pull request #1452 from lzutao/meson_getversion
meson: Remove unused sys import
2018-12-14 16:50:41 -08:00
Lzu Tao
066cfc069b meson: Remove unused sys import 2018-12-14 11:03:04 +07:00
Lzu Tao
3ee5504fb2 Simplify logic by setting default value for MESON_INSTALL_DESTDIR_PREFIX 2018-12-13 18:07:01 +07:00
Lzu Tao
ce22f76668 meson: Update man1 extension on meson 0.49.0 2018-12-13 14:58:17 +07:00
Lzu Tao
abfde03cb5 meson: Update meson symlink script usage 2018-12-13 14:58:17 +07:00
Lzu Tao
fa2fc274fd meson: Correct support for building on Windows
Let soversion base on version if not set. For example, if version is 3.6.0
and soversion is not defined, it is set to 3.
2018-12-13 14:58:17 +07:00
Lzu Tao
67babb6d23 Replace many os.path methods with pathlib one's
Use MESON_INSTALL_DESTDIR_PREFIX variable instead of DESTDIR.
2018-12-13 14:58:17 +07:00
Lzu Tao
f897523655 meson: Update usage of InstallSymlink helper 2018-12-03 11:02:42 +07:00
Lzu Tao
9d6cf606f8 meson: Update tests timeout to run properly 2018-12-03 03:23:09 +07:00
Lzu Tao
65507666bb Use -Dlegacy_level build option to control ZSTD_LEGACY_SUPPORT macro in test 2018-12-03 00:36:40 +07:00
Lzu Tao
437ec5f47f meson helper: Use Python conventional name for naming function [skip ci] 2018-12-02 22:48:11 +07:00
Lzu Tao
838de08439 meson: Fix soversion 2018-12-02 22:45:46 +07:00
Lzu Tao
23d751507e meson: Use -werror build option instead of adding -Werror [skip ci] 2018-12-02 22:33:43 +07:00
Lzu Tao
38728b4518 Use argparse instead of manually parsing [skip ci] 2018-12-02 22:33:43 +07:00
Lzu Tao
7da18bc85a Add missed .1 extension for manpage [skip ci] 2018-12-02 00:18:00 +07:00
Lzu Tao
cbf2a924dd meson: Cleanup installing symlinks 2018-12-01 23:18:59 +07:00
Lzu Tao
519b2de6f7 Update README 2018-12-01 23:18:59 +07:00
Lzu Tao
8d5252b68d meson: Remove redundant join_paths function 2018-12-01 23:18:59 +07:00
Lzu Tao
24bc513ea1 meson: Change build options' name 2018-12-01 23:18:59 +07:00
Lzu Tao
39f49ac39f Add almost all test cases in tests/Makefile 2018-12-01 23:18:59 +07:00
Lzu Tao
c55d65b35d Add clang cflags 2018-12-01 23:18:59 +07:00