[Cmake-commits] [cmake-commits] king committed cmTarget.cxx 1.243 1.244 cmTarget.h 1.125 1.126
cmake-commits at cmake.org
cmake-commits at cmake.org
Fri May 1 10:39:48 EDT 2009
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv32267/Source
Modified Files:
cmTarget.cxx cmTarget.h
Log Message:
ENH: Remove cmTarget internal type arguments
Internally cmTarget was passing the target type in several name
computation signatures to support computation of both shared and static
library names for one target. We no longer need to compute both names,
so this change simplifies the internals by using the GetType method and
dropping the type from method signatures.
Index: cmTarget.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.h,v
retrieving revision 1.125
retrieving revision 1.126
diff -C 2 -d -r1.125 -r1.126
*** cmTarget.h 1 May 2009 14:39:28 -0000 1.125
--- cmTarget.h 1 May 2009 14:39:44 -0000 1.126
***************
*** 449,474 ****
DependencyMap& dep_map);
! const char* GetSuffixVariableInternal(TargetType type, bool implib);
! const char* GetPrefixVariableInternal(TargetType type, bool implib);
! std::string GetFullNameInternal(TargetType type, const char* config,
! bool implib);
! void GetFullNameInternal(TargetType type, const char* config, bool implib,
std::string& outPrefix, std::string& outBase,
std::string& outSuffix);
- void GetLibraryNamesInternal(std::string& name,
- std::string& soName,
- std::string& realName,
- std::string& impName,
- std::string& pdbName,
- TargetType type,
- const char* config);
- void GetExecutableNamesInternal(std::string& name,
- std::string& realName,
- std::string& impName,
- std::string& pdbName,
- TargetType type,
- const char* config);
-
// Use a makefile variable to set a default for the given property.
// If the variable is not defined use the given default instead.
--- 449,459 ----
DependencyMap& dep_map);
! const char* GetSuffixVariableInternal(bool implib);
! const char* GetPrefixVariableInternal(bool implib);
! std::string GetFullNameInternal(const char* config, bool implib);
! void GetFullNameInternal(const char* config, bool implib,
std::string& outPrefix, std::string& outBase,
std::string& outSuffix);
// Use a makefile variable to set a default for the given property.
// If the variable is not defined use the given default instead.
Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.243
retrieving revision 1.244
diff -C 2 -d -r1.243 -r1.244
*** cmTarget.cxx 1 May 2009 14:39:17 -0000 1.243
--- cmTarget.cxx 1 May 2009 14:39:44 -0000 1.244
***************
*** 2320,2327 ****
//----------------------------------------------------------------------------
! const char* cmTarget::GetSuffixVariableInternal(TargetType type,
! bool implib)
{
! switch(type)
{
case cmTarget::STATIC_LIBRARY:
--- 2320,2326 ----
//----------------------------------------------------------------------------
! const char* cmTarget::GetSuffixVariableInternal(bool implib)
{
! switch(this->GetType())
{
case cmTarget::STATIC_LIBRARY:
***************
*** 2347,2354 ****
//----------------------------------------------------------------------------
! const char* cmTarget::GetPrefixVariableInternal(TargetType type,
! bool implib)
{
! switch(type)
{
case cmTarget::STATIC_LIBRARY:
--- 2346,2352 ----
//----------------------------------------------------------------------------
! const char* cmTarget::GetPrefixVariableInternal(bool implib)
{
! switch(this->GetType())
{
case cmTarget::STATIC_LIBRARY:
***************
*** 2376,2381 ****
std::string base;
std::string suffix;
! this->GetFullNameInternal(this->GetType(), config, false,
! prefix, base, suffix);
return prefix+base+".pdb";
}
--- 2374,2378 ----
std::string base;
std::string suffix;
! this->GetFullNameInternal(config, false, prefix, base, suffix);
return prefix+base+".pdb";
}
***************
*** 2479,2483 ****
else
{
! return this->GetFullNameInternal(this->GetType(), config, implib);
}
}
--- 2476,2480 ----
else
{
! return this->GetFullNameInternal(config, implib);
}
}
***************
*** 2495,2500 ****
bool implib)
{
! this->GetFullNameInternal(this->GetType(), config, implib,
! prefix, base, suffix);
}
--- 2492,2496 ----
bool implib)
{
! this->GetFullNameInternal(config, implib, prefix, base, suffix);
}
***************
*** 2567,2584 ****
//----------------------------------------------------------------------------
! std::string
! cmTarget::GetFullNameInternal(TargetType type, const char* config,
! bool implib)
{
std::string prefix;
std::string base;
std::string suffix;
! this->GetFullNameInternal(type, config, implib, prefix, base, suffix);
return prefix+base+suffix;
}
//----------------------------------------------------------------------------
! void cmTarget::GetFullNameInternal(TargetType type,
! const char* config,
bool implib,
std::string& outPrefix,
--- 2563,2577 ----
//----------------------------------------------------------------------------
! std::string cmTarget::GetFullNameInternal(const char* config, bool implib)
{
std::string prefix;
std::string base;
std::string suffix;
! this->GetFullNameInternal(config, implib, prefix, base, suffix);
return prefix+base+suffix;
}
//----------------------------------------------------------------------------
! void cmTarget::GetFullNameInternal(const char* config,
bool implib,
std::string& outPrefix,
***************
*** 2587,2594 ****
{
// Use just the target name for non-main target types.
! if(type != cmTarget::STATIC_LIBRARY &&
! type != cmTarget::SHARED_LIBRARY &&
! type != cmTarget::MODULE_LIBRARY &&
! type != cmTarget::EXECUTABLE)
{
outPrefix = "";
--- 2580,2587 ----
{
// Use just the target name for non-main target types.
! if(this->GetType() != cmTarget::STATIC_LIBRARY &&
! this->GetType() != cmTarget::SHARED_LIBRARY &&
! this->GetType() != cmTarget::MODULE_LIBRARY &&
! this->GetType() != cmTarget::EXECUTABLE)
{
outPrefix = "";
***************
*** 2611,2617 ****
// The implib option is only allowed for shared libraries, module
// libraries, and executables.
! if(type != cmTarget::SHARED_LIBRARY &&
! type != cmTarget::MODULE_LIBRARY &&
! type != cmTarget::EXECUTABLE)
{
implib = false;
--- 2604,2610 ----
// The implib option is only allowed for shared libraries, module
// libraries, and executables.
! if(this->GetType() != cmTarget::SHARED_LIBRARY &&
! this->GetType() != cmTarget::MODULE_LIBRARY &&
! this->GetType() != cmTarget::EXECUTABLE)
{
implib = false;
***************
*** 2638,2643 ****
}
}
! const char* prefixVar = this->GetPrefixVariableInternal(type, implib);
! const char* suffixVar = this->GetSuffixVariableInternal(type, implib);
const char* ll =
this->GetLinkerLanguage(
--- 2631,2636 ----
}
}
! const char* prefixVar = this->GetPrefixVariableInternal(implib);
! const char* suffixVar = this->GetSuffixVariableInternal(implib);
const char* ll =
this->GetLinkerLanguage(
***************
*** 2688,2692 ****
if(const char* version = this->GetProperty("VERSION"))
{
! if(type == cmTarget::SHARED_LIBRARY && !implib &&
this->Makefile->IsOn("CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION"))
{
--- 2681,2685 ----
if(const char* version = this->GetProperty("VERSION"))
{
! if(this->GetType() == cmTarget::SHARED_LIBRARY && !implib &&
this->Makefile->IsOn("CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION"))
{
***************
*** 2708,2725 ****
const char* config)
{
- // Get the names based on the real type of the library.
- this->GetLibraryNamesInternal(name, soName, realName, impName, pdbName,
- this->GetType(), config);
- }
-
- //----------------------------------------------------------------------------
- void cmTarget::GetLibraryNamesInternal(std::string& name,
- std::string& soName,
- std::string& realName,
- std::string& impName,
- std::string& pdbName,
- TargetType type,
- const char* config)
- {
// This should not be called for imported targets.
// TODO: Split cmTarget into a class hierarchy to get compile-time
--- 2701,2704 ----
***************
*** 2727,2731 ****
if(this->IsImported())
{
! std::string msg = "GetLibraryNamesInternal called on imported target: ";
msg += this->GetName();
this->Makefile->IssueMessage(cmake::INTERNAL_ERROR,
--- 2706,2710 ----
if(this->IsImported())
{
! std::string msg = "GetLibraryNames called on imported target: ";
msg += this->GetName();
this->Makefile->IssueMessage(cmake::INTERNAL_ERROR,
***************
*** 2749,2753 ****
const char* version = this->GetProperty("VERSION");
const char* soversion = this->GetProperty("SOVERSION");
! if((type != cmTarget::SHARED_LIBRARY && type != cmTarget::MODULE_LIBRARY) ||
!this->Makefile->GetDefinition(sonameFlag.c_str()) ||
this->IsFrameworkOnApple())
--- 2728,2733 ----
const char* version = this->GetProperty("VERSION");
const char* soversion = this->GetProperty("SOVERSION");
! if((this->GetType() != cmTarget::SHARED_LIBRARY &&
! this->GetType() != cmTarget::MODULE_LIBRARY) ||
!this->Makefile->GetDefinition(sonameFlag.c_str()) ||
this->IsFrameworkOnApple())
***************
*** 2769,2773 ****
std::string base;
std::string suffix;
! this->GetFullNameInternal(type, config, false, prefix, base, suffix);
// The library name.
--- 2749,2753 ----
std::string base;
std::string suffix;
! this->GetFullNameInternal(config, false, prefix, base, suffix);
// The library name.
***************
*** 2810,2817 ****
// The import library name.
! if(type == cmTarget::SHARED_LIBRARY ||
! type == cmTarget::MODULE_LIBRARY)
{
! impName = this->GetFullNameInternal(type, config, true);
}
else
--- 2790,2797 ----
// The import library name.
! if(this->GetType() == cmTarget::SHARED_LIBRARY ||
! this->GetType() == cmTarget::MODULE_LIBRARY)
{
! impName = this->GetFullNameInternal(config, true);
}
else
***************
*** 2831,2847 ****
const char* config)
{
- // Get the names based on the real type of the executable.
- this->GetExecutableNamesInternal(name, realName, impName, pdbName,
- this->GetType(), config);
- }
-
- //----------------------------------------------------------------------------
- void cmTarget::GetExecutableNamesInternal(std::string& name,
- std::string& realName,
- std::string& impName,
- std::string& pdbName,
- TargetType type,
- const char* config)
- {
// This should not be called for imported targets.
// TODO: Split cmTarget into a class hierarchy to get compile-time
--- 2811,2814 ----
***************
*** 2850,2854 ****
{
std::string msg =
! "GetExecutableNamesInternal called on imported target: ";
msg += this->GetName();
this->GetMakefile()->IssueMessage(cmake::INTERNAL_ERROR, msg.c_str());
--- 2817,2821 ----
{
std::string msg =
! "GetExecutableNames called on imported target: ";
msg += this->GetName();
this->GetMakefile()->IssueMessage(cmake::INTERNAL_ERROR, msg.c_str());
***************
*** 2862,2866 ****
// Check for executable version properties.
const char* version = this->GetProperty("VERSION");
! if(type != cmTarget::EXECUTABLE || this->Makefile->IsOn("XCODE"))
{
version = 0;
--- 2829,2833 ----
// Check for executable version properties.
const char* version = this->GetProperty("VERSION");
! if(this->GetType() != cmTarget::EXECUTABLE || this->Makefile->IsOn("XCODE"))
{
version = 0;
***************
*** 2872,2876 ****
std::string base;
std::string suffix;
! this->GetFullNameInternal(type, config, false, prefix, base, suffix);
// The executable name.
--- 2839,2843 ----
std::string base;
std::string suffix;
! this->GetFullNameInternal(config, false, prefix, base, suffix);
// The executable name.
***************
*** 2893,2897 ****
// The import library name.
! impName = this->GetFullNameInternal(type, config, true);
// The program database file name.
--- 2860,2864 ----
// The import library name.
! impName = this->GetFullNameInternal(config, true);
// The program database file name.
More information about the Cmake-commits
mailing list