summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorYves Starreveld <ystarrev@uwo.ca>2001-08-28 22:02:59 (GMT)
committerYves Starreveld <ystarrev@uwo.ca>2001-08-28 22:02:59 (GMT)
commit247c1640dabcf73f0d904379040d70c270ecddf6 (patch)
tree5383292cdd0841327c7cf7ef10cc9050ccb024fa /Source/cmMakefile.cxx
parent0b58132cd4ece384c8436da0a909bbe5d728038e (diff)
downloadCMake-247c1640dabcf73f0d904379040d70c270ecddf6.zip
CMake-247c1640dabcf73f0d904379040d70c270ecddf6.tar.gz
CMake-247c1640dabcf73f0d904379040d70c270ecddf6.tar.bz2
Changes to allow MODULE type target for a shared library
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx53
1 files changed, 46 insertions, 7 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 3eb2d61..89e8e5c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -608,11 +608,25 @@ void cmMakefile::SetProjectName(const char* p)
m_ProjectName = p;
}
-void cmMakefile::AddLibrary(const char* lname, bool shared,
+void cmMakefile::AddLibrary(const char* lname, int shared,
const std::vector<std::string> &srcs)
{
cmTarget target;
- target.SetType(shared? cmTarget::SHARED_LIBRARY : cmTarget::STATIC_LIBRARY);
+ switch (shared)
+ {
+ case 0:
+ target.SetType(cmTarget::STATIC_LIBRARY);
+ break;
+ case 1:
+ target.SetType(cmTarget::SHARED_LIBRARY);
+ break;
+ case 2:
+ target.SetType(cmTarget::MODULE_LIBRARY);
+ break;
+ default:
+ target.SetType(cmTarget::STATIC_LIBRARY);
+ }
+
target.SetInAll(true);
target.GetSourceLists() = srcs;
m_Targets.insert(cmTargets::value_type(lname,target));
@@ -626,11 +640,36 @@ void cmMakefile::AddLibrary(const char* lname, bool shared,
// Add an entry into the cache
std::string ltname = lname;
ltname += "_LIBRARY_TYPE";
- cmCacheManager::GetInstance()->
- AddCacheEntry(ltname.c_str(),
- shared? "SHARED":"STATIC",
- "Whether a library is static or shared.",
- cmCacheManager::INTERNAL);
+ switch (shared)
+ {
+ case 0:
+ cmCacheManager::GetInstance()->
+ AddCacheEntry(ltname.c_str(),
+ "STATIC",
+ "Whether a library is static, shared or module.",
+ cmCacheManager::INTERNAL);
+ break;
+ case 1:
+ cmCacheManager::GetInstance()->
+ AddCacheEntry(ltname.c_str(),
+ "SHARED",
+ "Whether a library is static, shared or module.",
+ cmCacheManager::INTERNAL);
+ break;
+ case 2:
+ cmCacheManager::GetInstance()->
+ AddCacheEntry(ltname.c_str(),
+ "MODULE",
+ "Whether a library is static, shared or module.",
+ cmCacheManager::INTERNAL);
+ break;
+ default:
+ cmCacheManager::GetInstance()->
+ AddCacheEntry(ltname.c_str(),
+ "STATIC",
+ "Whether a library is static, shared or module.",
+ cmCacheManager::INTERNAL);
+ }
}
void cmMakefile::AddExecutable(const char *exeName,