diff options
author | Brad King <brad.king@kitware.com> | 2022-09-14 13:21:08 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-09-14 13:21:27 (GMT) |
commit | c3e68020d61ae306261b4f953947483a960edf32 (patch) | |
tree | 49ab480611211dd6ee15714192dd8e29d22cbe7f /Source/cmCoreTryCompile.cxx | |
parent | e457663ac15e138ce7618d2f74c9656665ab139b (diff) | |
parent | a858466aacb046a953367aeb2ee6c456812fc2dd (diff) | |
download | CMake-c3e68020d61ae306261b4f953947483a960edf32.zip CMake-c3e68020d61ae306261b4f953947483a960edf32.tar.gz CMake-c3e68020d61ae306261b4f953947483a960edf32.tar.bz2 |
Merge topic 'MsvcDebugInformationFormatAbstraction'
a858466aac MSVC: Add test for debug information format
0e96a20478 MSVC: Add abstraction for debug information format
d4c8111da4 Clang/Windows: Clarify name of internal runtime library flags variables
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7606
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 654c9a3..75aef16 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -95,6 +95,8 @@ std::string const kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES = std::string const kCMAKE_WARN_DEPRECATED = "CMAKE_WARN_DEPRECATED"; std::string const kCMAKE_WATCOM_RUNTIME_LIBRARY_DEFAULT = "CMAKE_WATCOM_RUNTIME_LIBRARY_DEFAULT"; +std::string const kCMAKE_MSVC_DEBUG_INFORMATION_FORMAT_DEFAULT = + "CMAKE_MSVC_DEBUG_INFORMATION_FORMAT_DEFAULT"; /* GHS Multi platform variables */ std::set<std::string> const ghs_platform_vars{ @@ -498,6 +500,14 @@ bool cmCoreTryCompile::TryCompileCode(Arguments& arguments, *cmp0123 == "NEW"_s ? "NEW" : "OLD"); } + /* Set MSVC debug information format policy to match our selection. */ + if (cmValue msvcDebugInformationFormatDefault = + this->Makefile->GetDefinition( + kCMAKE_MSVC_DEBUG_INFORMATION_FORMAT_DEFAULT)) { + fprintf(fout, "cmake_policy(SET CMP0141 %s)\n", + !msvcDebugInformationFormatDefault->empty() ? "NEW" : "OLD"); + } + /* Set cache/normal variable policy to match outer project. It may affect toolchain files. */ if (this->Makefile->GetPolicyStatus(cmPolicies::CMP0126) != @@ -861,6 +871,7 @@ bool cmCoreTryCompile::TryCompileCode(Arguments& arguments, vars.insert(kCMAKE_WARN_DEPRECATED); vars.emplace("CMAKE_MSVC_RUNTIME_LIBRARY"_s); vars.emplace("CMAKE_WATCOM_RUNTIME_LIBRARY"_s); + vars.emplace("CMAKE_MSVC_DEBUG_INFORMATION_FORMAT"_s); if (cmValue varListStr = this->Makefile->GetDefinition( kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES)) { |