From: Eden Zik Date: Tue, 14 Aug 2018 00:28:52 +0000 (-0400) Subject: Cmake now builds with CMAKE_BUILD_TYPE=Release by default, both while X-Git-Tag: v0.0.29~44^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6df961497b766546db31b7876aef5b3718c17a4;p=thirdparty%2Fzstd.git Cmake now builds with CMAKE_BUILD_TYPE=Release by default, both while being invoked from the main Makefile (via cmakebuild) or directly from the build/cmake directory. Suggested by @pdknsk (#1081). --- diff --git a/Makefile b/Makefile index f67791275..6c4ab9c9b 100644 --- a/Makefile +++ b/Makefile @@ -114,7 +114,7 @@ clean: ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD MSYS_NT)) HOST_OS = POSIX -CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON +CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON -DCMAKE_BUILD_TYPE=Release .PHONY: list list: diff --git a/README.md b/README.md index 17edecb71..dc99dc0fd 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,8 @@ A `cmake` project generator is provided within `build/cmake`. It can generate Makefiles or other build scripts to create `zstd` binary, and `libzstd` dynamic and static libraries. +By default, `CMAKE_BUILD_TYPE` is set to `Release`. + #### Meson A Meson project is provided within `contrib/meson`. diff --git a/build/.gitignore b/build/.gitignore index b00e709ba..1ceb70ebc 100644 --- a/build/.gitignore +++ b/build/.gitignore @@ -18,3 +18,14 @@ Studio* # CMake cmake/build/ +CMakeCache.txt +CMakeFiles +CMakeScripts +Testing +Makefile +cmake_install.cmake +install_manifest.txt +compile_commands.json +CTestTestfile.cmake +build +lib diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt index fd9bc2b1e..1e2921de8 100644 --- a/build/cmake/CMakeLists.txt +++ b/build/cmake/CMakeLists.txt @@ -10,6 +10,10 @@ PROJECT(zstd) CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9) SET(ZSTD_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..") + +# Ensure Release build even if not invoked via Makefile +SET(CMAKE_BUILD_TYPE "Release") + LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") INCLUDE(GNUInstallDirs)