Files
CMake/Tests/RunCMake/VS10Project/DebugInformationFormat.cmake
Glen Chung 0e96a20478 MSVC: Add abstraction for debug information format
Replace our hard-coded default for `/Zi` with a first-class abstraction
to select the debug information format an enumeration of logical
names.  We've long hesitated to do this because the idea of "debug
information format" touches on related concepts on several platforms.
Avoid that scope creep by simply defining an abstraction that applies
only when targeting the MSVC ABI on Windows.

Removing the old default flag requires a policy because existing
projects may rely on string processing to edit them and choose a
runtime library under the old behavior.  Add policy CMP0141 to
provide compatibility.

Fixes: #10189
2022-09-14 09:12:47 -04:00

25 lines
855 B
CMake

set(CMAKE_CONFIGURATION_TYPES Debug Release MinSizeRel RelWithDebInfo)
cmake_policy(SET CMP0141 NEW)
enable_language(C)
enable_language(CXX)
add_library(default-C empty.c)
add_library(default-CXX empty.cxx)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "")
add_library(empty-C empty.c)
add_library(empty-CXX empty.cxx)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "Embedded")
add_library(Embedded-C empty.c)
add_library(Embedded-CXX empty.cxx)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase")
add_library(ProgramDatabase-C empty.c)
add_library(ProgramDatabase-CXX empty.cxx)
add_library(EditAndContinue-C empty.c)
set_property(TARGET EditAndContinue-C PROPERTY MSVC_DEBUG_INFORMATION_FORMAT "EditAndContinue")
add_library(EditAndContinue-CXX empty.cxx)
set_property(TARGET EditAndContinue-CXX PROPERTY MSVC_DEBUG_INFORMATION_FORMAT "EditAndContinue")