Browse Source

ENH: Added platform variable CMAKE_EXE_EXPORTS_<lang>_FLAG to add a linker flag when building executables that have the ENABLE_EXPORTS property set.

Brad King 18 years ago
parent
commit
721ff36924
1 changed files with 10 additions and 0 deletions
  1. 10 0
      Source/cmMakefileExecutableTargetGenerator.cxx

+ 10 - 0
Source/cmMakefileExecutableTargetGenerator.cxx

@@ -257,6 +257,16 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
       (linkFlags, this->Makefile->GetDefinition("CMAKE_CREATE_CONSOLE_EXE"));
       (linkFlags, this->Makefile->GetDefinition("CMAKE_CREATE_CONSOLE_EXE"));
     }
     }
 
 
+  // Add symbol export flags if necessary.
+  if(this->Target->GetPropertyAsBool("ENABLE_EXPORTS"))
+    {
+    std::string export_flag_var = "CMAKE_EXE_EXPORTS_";
+    export_flag_var += linkLanguage;
+    export_flag_var += "_FLAG";
+    this->LocalGenerator->AppendFlags
+      (linkFlags, this->Makefile->GetDefinition(export_flag_var.c_str()));
+    }
+
   // Add language-specific flags.
   // Add language-specific flags.
   this->LocalGenerator
   this->LocalGenerator
     ->AddLanguageFlags(flags, linkLanguage,
     ->AddLanguageFlags(flags, linkLanguage,