diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-06-22 13:58:10 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-06-22 13:58:10 (GMT) |
commit | f7d4f27c2a378317fa382fc1813ba7cb31cbd839 (patch) | |
tree | ecdf2d72c79c335abe372f892c2d560b1b2b5758 /Source/cmMakefile.cxx | |
parent | 1d9889c5d34d83b269697c0b09e840bf83066e6f (diff) | |
download | CMake-f7d4f27c2a378317fa382fc1813ba7cb31cbd839.zip CMake-f7d4f27c2a378317fa382fc1813ba7cb31cbd839.tar.gz CMake-f7d4f27c2a378317fa382fc1813ba7cb31cbd839.tar.bz2 |
ENH: add IMPORT keyword to ADD_LIBRARY, dependencies are not yet working
STYLE: fix line lengths and indentation, use enum as argument to AddLibrary() instead of int (which was initialized from a bool in some cases)
Alex
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 13422b1..b49f826 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1336,26 +1336,19 @@ void cmMakefile::AddGlobalLinkInformation(const char* name, cmTarget& target) } -void cmMakefile::AddLibrary(const char* lname, int shared, +void cmMakefile::AddLibrary(const char* lname, cmTarget::TargetType type, const std::vector<std::string> &srcs, bool excludeFromAll) { - cmTarget* target=0; - switch (shared) + // wrong type ? default to STATIC + if ( (type != cmTarget::STATIC_LIBRARY) + && (type != cmTarget::SHARED_LIBRARY) + && (type != cmTarget::MODULE_LIBRARY)) { - case 0: - target=this->AddNewTarget(cmTarget::STATIC_LIBRARY, lname, false); - break; - case 1: - target=this->AddNewTarget(cmTarget::SHARED_LIBRARY, lname, false); - break; - case 2: - target=this->AddNewTarget(cmTarget::MODULE_LIBRARY, lname, false); - break; - default: - target=this->AddNewTarget(cmTarget::STATIC_LIBRARY, lname, false); + type = cmTarget::STATIC_LIBRARY; } + cmTarget* target = this->AddNewTarget(type, lname, false); // Clear its dependencies. Otherwise, dependencies might persist // over changes in CMakeLists.txt, making the information stale and // hence useless. @@ -1383,21 +1376,25 @@ cmTarget* cmMakefile::AddExecutable(const char *exeName, } -cmTarget* cmMakefile::AddNewTarget(cmTarget::TargetType type, const char* name, bool isImported) +cmTarget* cmMakefile::AddNewTarget(cmTarget::TargetType type, + const char* name, + bool isImported) { cmTargets::iterator it; cmTarget target; target.SetType(type, name); target.SetMakefile(this); if (isImported) - { + { target.MarkAsImported(); - it=this->ImportedTargets.insert(cmTargets::value_type(target.GetName(), target)).first; - } + it=this->ImportedTargets.insert( + cmTargets::value_type(target.GetName(), target)).first; + } else - { - it=this->Targets.insert(cmTargets::value_type(target.GetName(), target)).first; - } + { + it=this->Targets.insert( + cmTargets::value_type(target.GetName(), target)).first; + } this->LocalGenerator->GetGlobalGenerator()->AddTarget(*it); return &it->second; } |