From: Antoine Pitrou Date: Tue, 6 Nov 2018 20:24:29 +0000 (+0100) Subject: Allow creating debug builds with CMake X-Git-Tag: v1.3.8~55^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1405%2Fhead;p=thirdparty%2Fzstd.git 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. --- diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt index 1e2921de8..56ae67bbf 100644 --- a/build/cmake/CMakeLists.txt +++ b/build/cmake/CMakeLists.txt @@ -7,12 +7,15 @@ # in the COPYING file in the root directory of this source tree). # ################################################################ -PROJECT(zstd) CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9) + +PROJECT(zstd) SET(ZSTD_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..") -# Ensure Release build even if not invoked via Makefile -SET(CMAKE_BUILD_TYPE "Release") +if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "No build type selected, defaulting to Release") + set(CMAKE_BUILD_TYPE "Release") +endif() LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") INCLUDE(GNUInstallDirs)