From 721ff3692430c8436a5d24fe8a83a20e9012b6bf Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 17 Apr 2007 23:39:47 -0400 Subject: [PATCH] ENH: Added platform variable CMAKE_EXE_EXPORTS__FLAG to add a linker flag when building executables that have the ENABLE_EXPORTS property set. --- Source/cmMakefileExecutableTargetGenerator.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 48aa2849d..677f9f3fd 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -257,6 +257,16 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) (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. this->LocalGenerator ->AddLanguageFlags(flags, linkLanguage,