Tests: Fix ConfigSources test with empty CMAKE_BUILD_TYPE

The test requires a non-empty `CMAKE_BUILD_TYPE` to function on
single-config generators.  Force a non-empty configuration if the test
is configured explicitly with empty `-DCMAKE_BUILD_TYPE=`.
This commit is contained in:
Brad King 2020-12-21 19:25:49 -05:00
parent 81809d1485
commit 3af0671019

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.0)
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT _isMultiConfig AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build" FORCE)
endif()
project(ConfigSources CXX)