mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-24 17:18:37 -05:00
VS: Restore unicode character set for custom targrets on WindowsStore
Restore conditions broken by commit 19a61e56cf (VS: Refactor MSVC
character set selection, 2025-10-10, v4.2.0-rc1~12^2~1). We had misread
the purpose/scope of the `<= cmStateEnums::OBJECT_LIBRARY` condition.
In the original code it was only about safely indexing `ClOptions`,
not about the kinds of targets that can use a unicode character set.
Fixes: #27490
This commit is contained in:
@@ -439,18 +439,20 @@ void cmVisualStudio10TargetGenerator::Generate()
|
||||
if (!this->ComputeLibOptions()) {
|
||||
return;
|
||||
}
|
||||
for (std::string const& config : this->Configurations) {
|
||||
// Default character set if not populated above.
|
||||
this->CharSet.emplace(
|
||||
config,
|
||||
(this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT") ||
|
||||
this->GlobalGenerator->TargetsWindowsPhone() ||
|
||||
this->GlobalGenerator->TargetsWindowsStore() ||
|
||||
this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
|
||||
? MsvcCharSet::Unicode
|
||||
: MsvcCharSet::MultiByte);
|
||||
}
|
||||
}
|
||||
|
||||
for (std::string const& config : this->Configurations) {
|
||||
// Default character set if not populated above.
|
||||
this->CharSet.emplace(
|
||||
config,
|
||||
(this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT") ||
|
||||
this->GlobalGenerator->TargetsWindowsPhone() ||
|
||||
this->GlobalGenerator->TargetsWindowsStore() ||
|
||||
this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
|
||||
? MsvcCharSet::Unicode
|
||||
: MsvcCharSet::MultiByte);
|
||||
}
|
||||
|
||||
std::string path =
|
||||
cmStrCat(this->LocalGenerator->GetCurrentBinaryDirectory(), '/',
|
||||
this->Name, ProjectFileExtension);
|
||||
@@ -1552,12 +1554,9 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
|
||||
e1.Element("UseOfMfc", useOfMfcValue);
|
||||
}
|
||||
|
||||
if ((this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY &&
|
||||
this->CharSet[config] == MsvcCharSet::Unicode)) {
|
||||
if (this->CharSet[config] == MsvcCharSet::Unicode) {
|
||||
e1.Element("CharacterSet", "Unicode");
|
||||
} else if (this->GeneratorTarget->GetType() <=
|
||||
cmStateEnums::OBJECT_LIBRARY &&
|
||||
this->CharSet[config] == MsvcCharSet::SingleByte) {
|
||||
} else if (this->CharSet[config] == MsvcCharSet::SingleByte) {
|
||||
e1.Element("CharacterSet", "NotSet");
|
||||
} else {
|
||||
e1.Element("CharacterSet", "MultiByte");
|
||||
|
||||
Reference in New Issue
Block a user