[Cmake-commits] [cmake-commits] king committed cmMakefile.cxx 1.524 1.525 cmMakefileLibraryTargetGenerator.cxx 1.81 1.82 cmMakefileTargetGenerator.cxx 1.127 1.128 cmTarget.cxx 1.274 1.275

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Oct 2 13:52:15 EDT 2009


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

Modified Files:
	cmMakefile.cxx cmMakefileLibraryTargetGenerator.cxx 
	cmMakefileTargetGenerator.cxx cmTarget.cxx 
Log Message:
Create INTERPROCEDURAL_OPTIMIZATION build feature

This commit creates target and directory properties to enable the Intel
interprocedural optimization support on Linux.  Enabling it adds the
compiler option '-ipo' and uses 'xiar' to create archives.

See issue #9615.


Index: cmMakefileLibraryTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileLibraryTargetGenerator.cxx,v
retrieving revision 1.81
retrieving revision 1.82
diff -C 2 -d -r1.81 -r1.82
*** cmMakefileLibraryTargetGenerator.cxx	2 Oct 2009 17:51:49 -0000	1.81
--- cmMakefileLibraryTargetGenerator.cxx	2 Oct 2009 17:52:13 -0000	1.82
***************
*** 114,117 ****
--- 114,123 ----
    linkRuleVar += "_CREATE_STATIC_LIBRARY";
  
+   if(this->GetFeatureAsBool("INTERPROCEDURAL_OPTIMIZATION") &&
+      this->Makefile->GetDefinition((linkRuleVar+"_IPO").c_str()))
+     {
+     linkRuleVar += "_IPO";
+     }
+ 
    std::string extraFlags;
    this->LocalGenerator->AppendFlags

Index: cmMakefileTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileTargetGenerator.cxx,v
retrieving revision 1.127
retrieving revision 1.128
diff -C 2 -d -r1.127 -r1.128
*** cmMakefileTargetGenerator.cxx	2 Oct 2009 17:52:01 -0000	1.127
--- cmMakefileTargetGenerator.cxx	2 Oct 2009 17:52:13 -0000	1.128
***************
*** 1781,1783 ****
--- 1781,1788 ----
    // Add language-specific flags.
    this->LocalGenerator->AddLanguageFlags(flags, lang, this->ConfigName);
+ 
+   if(this->GetFeatureAsBool("INTERPROCEDURAL_OPTIMIZATION"))
+     {
+     this->LocalGenerator->AppendFeatureOptions(flags, lang, "IPO");
+     }
  }

Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.274
retrieving revision 1.275
diff -C 2 -d -r1.274 -r1.275
*** cmTarget.cxx	2 Oct 2009 17:52:01 -0000	1.274
--- cmTarget.cxx	2 Oct 2009 17:52:13 -0000	1.275
***************
*** 422,425 ****
--- 422,438 ----
  
    cm->DefineProperty
+     ("INTERPROCEDURAL_OPTIMIZATION", cmProperty::TARGET,
+      "Enable interprocedural optimization for a target.",
+      "If set to true, enables interprocedural optimizations "
+      "if they are known to be supported by the compiler.");
+ 
+   cm->DefineProperty
+     ("INTERPROCEDURAL_OPTIMIZATION_<CONFIG>", cmProperty::TARGET,
+      "Per-configuration interprocedural optimization for a target.",
+      "This is a per-configuration version of INTERPROCEDURAL_OPTIMIZATION.  "
+      "If set, this property overrides the generic property "
+      "for the named configuration.");
+ 
+   cm->DefineProperty
      ("LABELS", cmProperty::TARGET,
       "Specify a list of text labels associated with a target.",

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.524
retrieving revision 1.525
diff -C 2 -d -r1.524 -r1.525
*** cmMakefile.cxx	2 Oct 2009 17:52:01 -0000	1.524
--- cmMakefile.cxx	2 Oct 2009 17:52:12 -0000	1.525
***************
*** 3556,3559 ****
--- 3556,3572 ----
  
    cm->DefineProperty
+     ("INTERPROCEDURAL_OPTIMIZATION", cmProperty::DIRECTORY,
+      "Enable interprocedural optimization for targets in a directory.",
+      "If set to true, enables interprocedural optimizations "
+      "if they are known to be supported by the compiler.");
+ 
+   cm->DefineProperty
+     ("INTERPROCEDURAL_OPTIMIZATION_<CONFIG>", cmProperty::DIRECTORY,
+      "Per-configuration interprocedural optimization for a directory.",
+      "This is a per-configuration version of INTERPROCEDURAL_OPTIMIZATION.  "
+      "If set, this property overrides the generic property "
+      "for the named configuration.");
+ 
+   cm->DefineProperty
      ("VARIABLES", cmProperty::DIRECTORY,
       "List of variables defined in the current directory.",



More information about the Cmake-commits mailing list