CMake: Warn if no build-type is selected.

pull/1039/head
Vollstrecker 3 months ago committed by Mark Adler
parent f7ab6e4373
commit e37a1a8345
  1. 9
      CMakeLists.txt

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.9)
project(zlib project(zlib
LANGUAGES C LANGUAGES C
@ -13,6 +13,13 @@ if(WIN32)
option(ZLIB_INSTALL_COMPAT_DLL "Install a copy as zlib1.dll" ON) option(ZLIB_INSTALL_COMPAT_DLL "Install a copy as zlib1.dll" ON)
endif(WIN32) endif(WIN32)
get_property(IS_MULTI GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT DEFINED CMAKE_BUILD_TYPE AND NOT IS_MULTI)
message(STATUS "No CMAKE_BUILD_TYPE set -- using Release")
set(CMAKE_BUILD_TYPE Release)
endif(NOT DEFINED CMAKE_BUILD_TYPE AND NOT IS_MULTI)
include(CheckTypeSize) include(CheckTypeSize)
include(CheckFunctionExists) include(CheckFunctionExists)
include(CheckIncludeFile) include(CheckIncludeFile)

Loading…
Cancel
Save