| 221 | constexpr char SBCS_DEFINITION_PREFIX[] = "_SBCS="; |
| 222 | |
| 223 | MsvcCharSetInfo 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 |
no test coverage detected
searching dependent graphs…