MCPcopy Create free account
hub / github.com/Kitware/CMake / GetMsvcCharSetInfo

Function GetMsvcCharSetInfo

Source/cmGeneratorTarget_Options.cxx:223–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221constexpr char SBCS_DEFINITION_PREFIX[] = "_SBCS=";
222
223MsvcCharSetInfo GetMsvcCharSetInfo(
224 cmGeneratorTarget const& tgt, std::string const& lang,
225 EvaluatedTargetPropertyEntries const& entries)
226{
227 using MsvcCharSet = cmGeneratorTarget::MsvcCharSet;
228
229 if (tgt.Makefile->GetSafeDefinition(
230 cmStrCat("CMAKE_", lang, "_COMPILER_ID")) != "MSVC"_s &&
231 tgt.Makefile->GetSafeDefinition(
232 cmStrCat("CMAKE_", lang, "_SIMULATE_ID")) != "MSVC"_s) {
233
234 // Only MSVC ABI uses this feature
235 return { MsvcCharSet::None, false };
236 }
237
238 for (EvaluatedTargetPropertyEntry const& entry : entries.Entries) {
239 for (std::string const& value : entry.Values) {
240 MsvcCharSet charSet = cmGeneratorTarget::GetMsvcCharSet(value);
241 if (charSet != MsvcCharSet::None) {
242 return { charSet, false };
243 }
244 }
245 }
246
247 // Default to multi-byte, similar to the Visual Studio generator
248 // Define the default charset for Visual Studio too:
249 // it should filter it out if need
250 return { MsvcCharSet::MultiByte, true };
251}
252
253}
254

Callers 1

GetCompileDefinitionsMethod · 0.85

Calls 1

cmStrCatFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…