summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
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,