build: fix default debug build for vscode
Check if CMAKE_BUILD_TYPE is false and not just empty string, as it is some kind of other empty value in the default vscode build and the check fails. If CMAKE_BUILD_TYPE is unset, default to Debug, which is what vscode and most things expect as the default CMAKE_BUILD_TYPE. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
f1d3f631d2
commit
83d24828df
|
@ -82,8 +82,8 @@ if(NOT CMAKE_PREFIX_PATH AND (NOT ("$ENV{CMAKE_PREFIX_PATH}" STREQUAL "")))
|
|||
set(CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "")
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE)
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE)
|
||||
elseif(NOT CMAKE_BUILD_TYPE MATCHES "^(Release|Debug|RelWithDebInfo|MinSizeRel)$")
|
||||
message(FATAL_ERROR "Invalid CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}', must be one of: 'Release', 'Debug', 'RelWithDebInfo' or 'MinSizeRel'")
|
||||
endif()
|
||||
|
|
Loading…
Reference in New Issue