diff options
author | Brad King <brad.king@kitware.com> | 2012-03-19 21:14:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-03-20 13:01:02 (GMT) |
commit | b291d9e756b76ce85ebcc314c14de532e8ad477f (patch) | |
tree | 1fa7e300567e215b929003dc913cea4a10225bc9 /Source | |
parent | 328c0f65c2a273c6adcdb11f96ee057d80014de2 (diff) | |
download | CMake-b291d9e756b76ce85ebcc314c14de532e8ad477f.zip CMake-b291d9e756b76ce85ebcc314c14de532e8ad477f.tar.gz CMake-b291d9e756b76ce85ebcc314c14de532e8ad477f.tar.bz2 |
VS10: Fix external objects generated outside target (#13047)
Commit 9a6ff950 (Fix for bug where VS2010 did not use .obj files,
2011-04-01) assumed that if an external object is GENERATED that it is
the output of a custom command in the current target. If it is
generated by another target then VS will not automatically include the
external object in the current target. This bug was preserved by the
refactoring in the parent commit.
Instead use <None> for external objects generated by a custom command in
the current target and <Object> for all other external objects. Update
the ExternalOBJ test to cover this case.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 88ad178..6caaad1 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -857,19 +857,10 @@ void cmVisualStudio10TargetGenerator::WriteAllSources() si = this->GeneratorTarget->ExternalObjects.begin(); si != this->GeneratorTarget->ExternalObjects.end(); ++si) { - // If an object file is generated, then vs10 - // will use it in the build, and we have to list - // it as None instead of Object - if((*si)->GetPropertyAsBool("GENERATED")) - { - this->WriteSource("None", *si); - } - // If it is not a generated object then we have - // to use the Object type - else - { - this->WriteSource("Object", *si); - } + // If an object file is generated in this target, then vs10 will use + // it in the build, and we have to list it as None instead of Object. + std::vector<cmSourceFile*> const* d = this->Target->GetSourceDepends(*si); + this->WriteSource((d && !d->empty())? "None":"Object", *si); } this->WriteSources("None", this->GeneratorTarget->ExtraSources); |