summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-07-02 19:38:10 (GMT)
committerBrad King <brad.king@kitware.com>2014-07-09 13:43:42 (GMT)
commit2c470b775ab54f565383c95200d16dc42d94fe17 (patch)
tree16072279bce09969004c90ea4dc55384c8265cf0 /Source/cmGeneratorTarget.cxx
parentde4f3e2c82a92a7dfc6305a09cc32d9d5c6e8c34 (diff)
downloadCMake-2c470b775ab54f565383c95200d16dc42d94fe17.zip
CMake-2c470b775ab54f565383c95200d16dc42d94fe17.tar.gz
CMake-2c470b775ab54f565383c95200d16dc42d94fe17.tar.bz2
add_library: Allow arbitrary non-linked sources in OBJECT libraries
Loosen this restriction on OBJECT libraries to allow source files of any name to be generated by custom commands or listed for reference in IDE projects so long as they would not affect linking of a normal library. Update the rejection message to be more specific about the looser restriction. Extend the ObjectLibrary test to cover a ".cmake" file generated by a custom command in an OBJECT library.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index eccb06a..64c5822 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -38,7 +38,8 @@ void reportBadObjLib(std::vector<cmSourceFile*> const& badObjLib,
{
e << " " << (*i)->GetLocation().GetName() << "\n";
}
- e << "but may contain only headers and sources that compile.";
+ e << "but may contain only sources that compile, header files, and "
+ "other files that would not affect linking of a normal library.";
cm->IssueMessage(cmake::FATAL_ERROR, e.str(),
target->GetBacktrace());
}
@@ -205,10 +206,6 @@ struct TagVisitor
else
{
DoAccept<IsSameTag<Tag, ExtraSourcesTag>::Result>::Do(this->Data, sf);
- if(this->IsObjLib && ext != "txt")
- {
- this->BadObjLibFiles.push_back(sf);
- }
}
}
};