From 82a174182aa276658911fe2b12613b1e8c6663a9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 13 Feb 2024 15:15:34 -0500 Subject: cmVisualStudioGeneratorOptions: Add UsingDebugRuntime method --- Source/cmVisualStudioGeneratorOptions.cxx | 9 +++++++++ Source/cmVisualStudioGeneratorOptions.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 8b803a9..659510c 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -124,6 +124,15 @@ bool cmVisualStudioGeneratorOptions::UsingDebugInfo() const return false; } +cm::optional cmVisualStudioGeneratorOptions::UsingDebugRuntime() const +{ + cm::optional result; + if (const char* rtl = this->GetFlag("RuntimeLibrary")) { + result = strstr(rtl, "Debug") != nullptr; + } + return result; +} + bool cmVisualStudioGeneratorOptions::IsWinRt() const { return this->FlagMap.find("CompileAsWinRT") != this->FlagMap.end(); diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h index d045929..1ca569d 100644 --- a/Source/cmVisualStudioGeneratorOptions.h +++ b/Source/cmVisualStudioGeneratorOptions.h @@ -7,6 +7,8 @@ #include #include +#include + #include "cmGlobalVisualStudioGenerator.h" #include "cmIDEFlagTable.h" #include "cmIDEOptions.h" @@ -66,6 +68,7 @@ public: void FixManifestUACFlags(); bool UsingDebugInfo() const; + cm::optional UsingDebugRuntime() const; bool IsWinRt() const; bool IsManaged() const; // Write options to output. -- cgit v0.12