Commit Graph

184 Commits

Author SHA1 Message Date
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
Lzu Tao
0a0683f5b2 Initial support for Windows build 2018-12-01 23:18:59 +07:00
Lzu Tao
2337429e8d Change tabsize 2018-12-01 23:18:59 +07:00
Lzu Tao
c4fb45ffe8 Add comment about looking for dependencies 2018-12-01 23:18:59 +07:00
Lzu Tao
918e0d5c36 Rename some meson build options to match autoconf convention 2018-12-01 23:18:59 +07:00
Lzu Tao
9ac9cbc9de Enable debugging flag 2018-12-01 23:18:59 +07:00
Lzu Tao
0669392937 Update relevant files after moving meson to build/
Update meson build instructions
2018-12-01 23:18:59 +07:00
Lzu Tao
beb13bd87e Move contrib/meson to build/meson 2018-12-01 23:18:59 +07:00
Yann Collet
e4abd28769 fixed VS2010+ build script 2018-11-13 13:22:16 -08:00
Yann Collet
f15312e884 fixed cmake build script 2018-11-13 13:16:41 -08:00
Antoine Pitrou
2186fbcf67 Allow creating debug builds with CMake
Only set the build type to Release if the user didn't select any.
See discussion in https://github.com/facebook/zstd/pull/1278#issuecomment-436327923
and below.
2018-11-06 21:24:29 +01:00
Yann Collet
4ed9233db6 fixed VS2010 project 2018-10-26 11:25:40 -07:00