mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
cmVisualStudio10TargetGenerator: only write a single object filename
Fixes: #27552
This commit is contained in:
@@ -2741,13 +2741,19 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
|
||||
customObjectName =
|
||||
this->LocalGenerator->GetCustomObjectFileName(*si.Source);
|
||||
}
|
||||
if (customObjectName.empty()) {
|
||||
if (this->GeneratorTarget->HasExplicitObjectName(si.Source)) {
|
||||
customObjectName = this->GeneratorTarget->GetObjectName(si.Source);
|
||||
}
|
||||
} else {
|
||||
customObjectName = cmStrCat(std::move(customObjectName), ".obj");
|
||||
}
|
||||
if (!customObjectName.empty()) {
|
||||
std::string outputName = "ObjectFileName";
|
||||
if (si.Source->GetLanguage() == "CUDA"_s) {
|
||||
outputName = "CompileOut";
|
||||
}
|
||||
e2.Element(outputName,
|
||||
cmStrCat("$(IntDir)", customObjectName, ".obj"));
|
||||
e2.Element(outputName, cmStrCat("$(IntDir)", customObjectName));
|
||||
}
|
||||
|
||||
this->FinishWritingSource(e2, toolSettings);
|
||||
@@ -2849,15 +2855,6 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
|
||||
}
|
||||
|
||||
bool noWinRT = this->TargetCompileAsWinRT && lang == "C"_s;
|
||||
// for the first time we need a new line if there is something
|
||||
// produced here.
|
||||
if (!objectName.empty()) {
|
||||
if (lang == "CUDA"_s) {
|
||||
e2.Element("CompileOut", cmStrCat("$(IntDir)/", objectName));
|
||||
} else {
|
||||
e2.Element("ObjectFileName", cmStrCat("$(IntDir)/", objectName));
|
||||
}
|
||||
}
|
||||
|
||||
if (lang == "ASM_NASM"_s) {
|
||||
if (cmValue objectDeps = sf.GetProperty("OBJECT_DEPENDS")) {
|
||||
|
||||
Reference in New Issue
Block a user