[Cmake-commits] [cmake-commits] king committed cmComputeLinkInformation.cxx 1.47 1.48 cmGlobalXCodeGenerator.cxx 1.214 1.215 cmLocalGenerator.cxx 1.301 1.302 cmLocalVisualStudio6Generator.cxx 1.156 1.157 cmLocalVisualStudio7Generator.cxx 1.244 1.245 cmMakefileExecutableTargetGenerator.cxx 1.58 1.59 cmMakefileLibraryTargetGenerator.cxx 1.74 1.75 cmTarget.cxx 1.250 1.251 cmTarget.h 1.130 1.131 cmVisualStudio10TargetGenerator.cxx 1.5 1.6

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Jul 7 07:44:14 EDT 2009


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv23751/Source

Modified Files:
	cmComputeLinkInformation.cxx cmGlobalXCodeGenerator.cxx 
	cmLocalGenerator.cxx cmLocalVisualStudio6Generator.cxx 
	cmLocalVisualStudio7Generator.cxx 
	cmMakefileExecutableTargetGenerator.cxx 
	cmMakefileLibraryTargetGenerator.cxx cmTarget.cxx cmTarget.h 
	cmVisualStudio10TargetGenerator.cxx 
Log Message:
ENH: Simpler cmTarget::GetLinkerLanguage signature

This method previously required the global generator to be passed, but
that was left from before cmTarget had its Makefile member.  Now the
global generator can be retrieved automatically, so we can drop the
method argument.


Index: cmVisualStudio10TargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmVisualStudio10TargetGenerator.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -C 2 -d -r1.5 -r1.6
*** cmVisualStudio10TargetGenerator.cxx	28 Jun 2009 12:59:56 -0000	1.5
--- cmVisualStudio10TargetGenerator.cxx	7 Jul 2009 11:44:12 -0000	1.6
***************
*** 447,452 ****
      (sf.GetExtension().c_str());
    const char* sourceLang = this->LocalGenerator->GetSourceFileLanguage(sf);
!   const char* linkLanguage = this->Target->GetLinkerLanguage
!     (this->LocalGenerator->GetGlobalGenerator());
    bool needForceLang = false;
    // source file does not match its extension language
--- 447,451 ----
      (sf.GetExtension().c_str());
    const char* sourceLang = this->LocalGenerator->GetSourceFileLanguage(sf);
!   const char* linkLanguage = this->Target->GetLinkerLanguage();
    bool needForceLang = false;
    // source file does not match its extension language
***************
*** 584,589 ****
    // assume incremental linking
    const char* incremental = "true";
!   const char* linkLanguage = 
!     this->Target->GetLinkerLanguage(this->GlobalGenerator);
    if(!linkLanguage)
      {
--- 583,587 ----
    // assume incremental linking
    const char* incremental = "true";
!   const char* linkLanguage = this->Target->GetLinkerLanguage();
    if(!linkLanguage)
      {
***************
*** 641,646 ****
    if(this->Target->GetType() < cmTarget::UTILITY)
      {
!     const char* linkLanguage = 
!       this->Target->GetLinkerLanguage(this->GlobalGenerator);
      if(!linkLanguage)
        {
--- 639,643 ----
    if(this->Target->GetType() < cmTarget::UTILITY)
      {
!     const char* linkLanguage = this->Target->GetLinkerLanguage();
      if(!linkLanguage)
        {
***************
*** 776,781 ****
      return;
      }
!   const char* linkLanguage = 
!     this->Target->GetLinkerLanguage(this->GlobalGenerator);
    if(!linkLanguage)
      {
--- 773,777 ----
      return;
      }
!   const char* linkLanguage = this->Target->GetLinkerLanguage();
    if(!linkLanguage)
      {

Index: cmLocalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v
retrieving revision 1.244
retrieving revision 1.245
diff -C 2 -d -r1.244 -r1.245
*** cmLocalVisualStudio7Generator.cxx	3 Jul 2009 14:33:45 -0000	1.244
--- cmLocalVisualStudio7Generator.cxx	7 Jul 2009 11:44:10 -0000	1.245
***************
*** 657,662 ****
    if(strcmp(configType, "10") != 0)
      {
!     const char* linkLanguage = 
!       target.GetLinkerLanguage(this->GetGlobalGenerator());
      if(!linkLanguage)
        {
--- 657,661 ----
    if(strcmp(configType, "10") != 0)
      {
!     const char* linkLanguage = target.GetLinkerLanguage();
      if(!linkLanguage)
        {
***************
*** 1364,1369 ****
        (sf.GetExtension().c_str());
      const char* sourceLang = lg->GetSourceFileLanguage(sf);
!     const char* linkLanguage = target.GetLinkerLanguage
!       (lg->GetGlobalGenerator());
      bool needForceLang = false;
      // source file does not match its extension language
--- 1363,1367 ----
        (sf.GetExtension().c_str());
      const char* sourceLang = lg->GetSourceFileLanguage(sf);
!     const char* linkLanguage = target.GetLinkerLanguage();
      bool needForceLang = false;
      // source file does not match its extension language

Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.301
retrieving revision 1.302
diff -C 2 -d -r1.301 -r1.302
*** cmLocalGenerator.cxx	24 Apr 2009 15:17:59 -0000	1.301
--- cmLocalGenerator.cxx	7 Jul 2009 11:44:09 -0000	1.302
***************
*** 698,703 ****
        case cmTarget::EXECUTABLE: 
          {
!         const char* llang = 
!           target.GetLinkerLanguage(this->GetGlobalGenerator());
          if(!llang)
            {
--- 698,702 ----
        case cmTarget::EXECUTABLE: 
          {
!         const char* llang = target.GetLinkerLanguage();
          if(!llang)
            {
***************
*** 1456,1461 ****
          linkFlags += " ";
          } 
!       const char* linkLanguage = 
!         target.GetLinkerLanguage(this->GetGlobalGenerator());
        if(!linkLanguage)
          {
--- 1455,1459 ----
          linkFlags += " ";
          } 
!       const char* linkLanguage = target.GetLinkerLanguage();
        if(!linkLanguage)
          {

Index: cmGlobalXCodeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v
retrieving revision 1.214
retrieving revision 1.215
diff -C 2 -d -r1.214 -r1.215
*** cmGlobalXCodeGenerator.cxx	2 Jul 2009 18:14:01 -0000	1.214
--- cmGlobalXCodeGenerator.cxx	7 Jul 2009 11:44:08 -0000	1.215
***************
*** 636,640 ****
    else if(ext == "h" || ext == "hxx" || ext == "hpp")
      {
!     const char* linkLanguage = cmtarget.GetLinkerLanguage(this);
      if(linkLanguage && (std::string(linkLanguage) == "CXX"))
        {
--- 636,640 ----
    else if(ext == "h" || ext == "hxx" || ext == "hpp")
      {
!     const char* linkLanguage = cmtarget.GetLinkerLanguage();
      if(linkLanguage && (std::string(linkLanguage) == "CXX"))
        {
***************
*** 1383,1387 ****
                   (target.GetType() == cmTarget::MODULE_LIBRARY));
  
!   const char* lang = target.GetLinkerLanguage(this);
    std::string cflags;
    if(lang)
--- 1383,1387 ----
                   (target.GetType() == cmTarget::MODULE_LIBRARY));
  
!   const char* lang = target.GetLinkerLanguage();
    std::string cflags;
    if(lang)

Index: cmComputeLinkInformation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkInformation.cxx,v
retrieving revision 1.47
retrieving revision 1.48
diff -C 2 -d -r1.47 -r1.48
*** cmComputeLinkInformation.cxx	11 Jun 2009 18:57:47 -0000	1.47
--- cmComputeLinkInformation.cxx	7 Jul 2009 11:44:07 -0000	1.48
***************
*** 265,270 ****
  
    // Get the language used for linking this target.
!   this->LinkLanguage =
!     this->Target->GetLinkerLanguage(this->GlobalGenerator);
    if(!this->LinkLanguage)
      {
--- 265,269 ----
  
    // Get the language used for linking this target.
!   this->LinkLanguage = this->Target->GetLinkerLanguage();
    if(!this->LinkLanguage)
      {

Index: cmLocalVisualStudio6Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio6Generator.cxx,v
retrieving revision 1.156
retrieving revision 1.157
diff -C 2 -d -r1.156 -r1.157
*** cmLocalVisualStudio6Generator.cxx	3 Jul 2009 14:33:45 -0000	1.156
--- cmLocalVisualStudio6Generator.cxx	7 Jul 2009 11:44:10 -0000	1.157
***************
*** 1139,1144 ****
      {
      // Get the language to use for linking.
!     const char* linkLanguage = 
!       target.GetLinkerLanguage(this->GetGlobalGenerator());
      if(!linkLanguage)
        {
--- 1139,1143 ----
      {
      // Get the language to use for linking.
!     const char* linkLanguage = target.GetLinkerLanguage();
      if(!linkLanguage)
        {
***************
*** 1439,1444 ****
         target.GetType() <= cmTarget::MODULE_LIBRARY)
        {
!       const char* linkLanguage = 
!         target.GetLinkerLanguage(this->GetGlobalGenerator());
        if(!linkLanguage)
          {
--- 1438,1442 ----
         target.GetType() <= cmTarget::MODULE_LIBRARY)
        {
!       const char* linkLanguage = target.GetLinkerLanguage();
        if(!linkLanguage)
          {

Index: cmMakefileLibraryTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileLibraryTargetGenerator.cxx,v
retrieving revision 1.74
retrieving revision 1.75
diff -C 2 -d -r1.74 -r1.75
*** cmMakefileLibraryTargetGenerator.cxx	3 Jul 2009 14:34:10 -0000	1.74
--- cmMakefileLibraryTargetGenerator.cxx	7 Jul 2009 11:44:11 -0000	1.75
***************
*** 110,115 ****
  void cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules()
  {
!   const char* linkLanguage =
!     this->Target->GetLinkerLanguage(this->GlobalGenerator);
    std::string linkRuleVar = "CMAKE_";
    if (linkLanguage)
--- 110,114 ----
  void cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules()
  {
!   const char* linkLanguage = this->Target->GetLinkerLanguage();
    std::string linkRuleVar = "CMAKE_";
    if (linkLanguage)
***************
*** 133,138 ****
      return;
      }
!   const char* linkLanguage =
!     this->Target->GetLinkerLanguage(this->GlobalGenerator);
    std::string linkRuleVar = "CMAKE_";
    if (linkLanguage)
--- 132,136 ----
      return;
      }
!   const char* linkLanguage = this->Target->GetLinkerLanguage();
    std::string linkRuleVar = "CMAKE_";
    if (linkLanguage)
***************
*** 179,184 ****
  void cmMakefileLibraryTargetGenerator::WriteModuleLibraryRules(bool relink)
  {
!   const char* linkLanguage =
!     this->Target->GetLinkerLanguage(this->GlobalGenerator);
    std::string linkRuleVar = "CMAKE_";
    if (linkLanguage)
--- 177,181 ----
  void cmMakefileLibraryTargetGenerator::WriteModuleLibraryRules(bool relink)
  {
!   const char* linkLanguage = this->Target->GetLinkerLanguage();
    std::string linkRuleVar = "CMAKE_";
    if (linkLanguage)
***************
*** 205,210 ****
  void cmMakefileLibraryTargetGenerator::WriteFrameworkRules(bool relink)
  {
!   const char* linkLanguage =
!     this->Target->GetLinkerLanguage(this->GlobalGenerator);
    std::string linkRuleVar = "CMAKE_";
    if (linkLanguage)
--- 202,206 ----
  void cmMakefileLibraryTargetGenerator::WriteFrameworkRules(bool relink)
  {
!   const char* linkLanguage = this->Target->GetLinkerLanguage();
    std::string linkRuleVar = "CMAKE_";
    if (linkLanguage)
***************
*** 352,357 ****
    
    // Get the language to use for linking this library.
!   const char* linkLanguage =
!     this->Target->GetLinkerLanguage(this->GlobalGenerator);
  
    // Make sure we have a link language.
--- 348,352 ----
    
    // Get the language to use for linking this library.
!   const char* linkLanguage = this->Target->GetLinkerLanguage();
  
    // Make sure we have a link language.

Index: cmTarget.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.h,v
retrieving revision 1.130
retrieving revision 1.131
diff -C 2 -d -r1.130 -r1.131
*** cmTarget.h	6 Jul 2009 20:25:20 -0000	1.130
--- cmTarget.h	7 Jul 2009 11:44:12 -0000	1.131
***************
*** 302,306 ****
  
    ///! Return the prefered linker language for this target
!   const char* GetLinkerLanguage(cmGlobalGenerator*);
  
    ///! Return the rule variable used to create this type of target,
--- 302,306 ----
  
    ///! Return the prefered linker language for this target
!   const char* GetLinkerLanguage();
  
    ///! Return the rule variable used to create this type of target,

Index: cmMakefileExecutableTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileExecutableTargetGenerator.cxx,v
retrieving revision 1.58
retrieving revision 1.59
diff -C 2 -d -r1.58 -r1.59
*** cmMakefileExecutableTargetGenerator.cxx	3 Jul 2009 14:34:08 -0000	1.58
--- cmMakefileExecutableTargetGenerator.cxx	7 Jul 2009 11:44:11 -0000	1.59
***************
*** 179,184 ****
  
    // Get the language to use for linking this executable.
!   const char* linkLanguage =
!     this->Target->GetLinkerLanguage(this->GlobalGenerator);
  
    // Make sure we have a link language.
--- 179,183 ----
  
    // Get the language to use for linking this executable.
!   const char* linkLanguage = this->Target->GetLinkerLanguage();
  
    // Make sure we have a link language.

Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.250
retrieving revision 1.251
diff -C 2 -d -r1.250 -r1.251
*** cmTarget.cxx	6 Jul 2009 20:25:20 -0000	1.250
--- cmTarget.cxx	7 Jul 2009 11:44:11 -0000	1.251
***************
*** 2284,2289 ****
  
  //----------------------------------------------------------------------------
! const char* cmTarget::GetLinkerLanguage(cmGlobalGenerator* gg)
  {
    if(this->GetProperty("HAS_CXX"))
      {
--- 2284,2291 ----
  
  //----------------------------------------------------------------------------
! const char* cmTarget::GetLinkerLanguage()
  {
+   cmGlobalGenerator* gg =
+     this->Makefile->GetLocalGenerator()->GetGlobalGenerator();
    if(this->GetProperty("HAS_CXX"))
      {
***************
*** 2670,2676 ****
    const char* prefixVar = this->GetPrefixVariableInternal(implib);
    const char* suffixVar = this->GetSuffixVariableInternal(implib);
!   const char* ll =
!     this->GetLinkerLanguage(
!       this->Makefile->GetLocalGenerator()->GetGlobalGenerator());
    // first try language specific suffix
    if(ll)
--- 2672,2676 ----
    const char* prefixVar = this->GetPrefixVariableInternal(implib);
    const char* suffixVar = this->GetSuffixVariableInternal(implib);
!   const char* ll = this->GetLinkerLanguage();
    // first try language specific suffix
    if(ll)
***************
*** 2751,2757 ****
  
    // Construct the name of the soname flag variable for this language.
!   const char* ll =
!     this->GetLinkerLanguage(
!       this->Makefile->GetLocalGenerator()->GetGlobalGenerator());
    std::string sonameFlag = "CMAKE_SHARED_LIBRARY_SONAME";
    if(ll)
--- 2751,2755 ----
  
    // Construct the name of the soname flag variable for this language.
!   const char* ll = this->GetLinkerLanguage();
    std::string sonameFlag = "CMAKE_SHARED_LIBRARY_SONAME";
    if(ll)
***************
*** 3043,3048 ****
  
    // Check for rpath support on this platform.
!   if(const char* ll = this->GetLinkerLanguage(
!        this->Makefile->GetLocalGenerator()->GetGlobalGenerator()))
      {
      std::string flagVar = "CMAKE_SHARED_LIBRARY_RUNTIME_";
--- 3041,3045 ----
  
    // Check for rpath support on this platform.
!   if(const char* ll = this->GetLinkerLanguage())
      {
      std::string flagVar = "CMAKE_SHARED_LIBRARY_RUNTIME_";
***************
*** 3369,3374 ****
    // Enable if the rpath flag uses a separator and the target uses ELF
    // binaries.
!   if(const char* ll = this->GetLinkerLanguage(
!        this->Makefile->GetLocalGenerator()->GetGlobalGenerator()))
      {
      std::string sepVar = "CMAKE_SHARED_LIBRARY_RUNTIME_";
--- 3366,3370 ----
    // Enable if the rpath flag uses a separator and the target uses ELF
    // binaries.
!   if(const char* ll = this->GetLinkerLanguage())
      {
      std::string sepVar = "CMAKE_SHARED_LIBRARY_RUNTIME_";



More information about the Cmake-commits mailing list