summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-06-12 20:01:21 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-06-12 20:01:21 (GMT)
commitbc5177b99e86e2f30926bbb183479a233dc4b544 (patch)
tree82e246153d35c9fe2a7e45825cb8d13dfb247a48 /Source
parentc95d1baa194c8108841a8b973d3bbe50ca7d5666 (diff)
parent9a9b3e45e3da8347abb00c79c8f9e2e94a530820 (diff)
downloadCMake-bc5177b99e86e2f30926bbb183479a233dc4b544.zip
CMake-bc5177b99e86e2f30926bbb183479a233dc4b544.tar.gz
CMake-bc5177b99e86e2f30926bbb183479a233dc4b544.tar.bz2
Merge topic 'object-library-is-not-shared'
9a9b3e4 add_library: Allow OBJECT library without dynamic linking (#13289)
Diffstat (limited to 'Source')
-rw-r--r--Source/cmAddLibraryCommand.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index c1d0e9d..fd39eec 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -102,16 +102,17 @@ bool cmAddLibraryCommand
STATIC. But at this point we know only the name of the target, but not
yet its linker language. */
if ((type != cmTarget::STATIC_LIBRARY) &&
+ (type != cmTarget::OBJECT_LIBRARY) &&
(this->Makefile->GetCMakeInstance()->GetPropertyAsBool(
"TARGET_SUPPORTS_SHARED_LIBS") == false))
{
- std::string msg = "ADD_LIBRARY for library ";
- msg += args[0];
- msg += " is used with the ";
- msg += type==cmTarget::SHARED_LIBRARY ? "SHARED" : "MODULE";
- msg += " option, but the target platform supports only STATIC libraries. "
- "Building it STATIC instead. This may lead to problems.";
- cmSystemTools::Message(msg.c_str() ,"Warning");
+ cmOStringStream w;
+ w <<
+ "ADD_LIBRARY called with " <<
+ (type==cmTarget::SHARED_LIBRARY ? "SHARED" : "MODULE") <<
+ " option but the target platform does not support dynamic linking. "
+ "Building a STATIC library instead. This may lead to problems.";
+ this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
type = cmTarget::STATIC_LIBRARY;
}