Commit 83703bda authored by Stephen Kelly's avatar Stephen Kelly
Browse files

cmGeneratorTarget: Copy IsExecutableWithExports from cmTarget.

parent 9afbb733
......@@ -635,7 +635,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
{
// Compute the proper name to use to link this library.
const std::string& config = this->Config;
bool impexe = (tgt && tgt->Target->IsExecutableWithExports());
bool impexe = (tgt && tgt->IsExecutableWithExports());
if(impexe && !this->UseImportLibrary && !this->LoaderFlag)
{
// Skip linking to executables on platforms with no import
......
......@@ -325,7 +325,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
// within the project.
if(dependee &&
dependee->GetType() == cmState::EXECUTABLE &&
!dependee->Target->IsExecutableWithExports())
!dependee->IsExecutableWithExports())
{
dependee = 0;
}
......@@ -401,7 +401,7 @@ void cmComputeTargetDepends::AddTargetDepend(
// within the project.
if(linking && dependee &&
dependee->GetType() == cmState::EXECUTABLE &&
!dependee->Target->IsExecutableWithExports())
!dependee->IsExecutableWithExports())
{
dependee = 0;
}
......
......@@ -220,7 +220,7 @@ cmExportBuildFileGenerator
// Add the import library for windows DLLs.
if(dll_platform &&
(target->GetType() == cmState::SHARED_LIBRARY ||
target->Target->IsExecutableWithExports()) &&
target->IsExecutableWithExports()) &&
mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"))
{
std::string prop = "IMPORTED_IMPLIB";
......
......@@ -1075,7 +1075,7 @@ cmExportFileGenerator
}
// Mark the imported executable if it has exports.
if(target->Target->IsExecutableWithExports())
if(target->IsExecutableWithExports())
{
os << "set_property(TARGET " << targetName
<< " PROPERTY ENABLE_EXPORTS 1)\n";
......
......@@ -4571,7 +4571,7 @@ cmGeneratorTarget::GetLinkInterface(const std::string& config,
// Link interfaces are not supported for executables that do not
// export symbols.
if(this->GetType() == cmState::EXECUTABLE &&
!this->Target->IsExecutableWithExports())
!this->IsExecutableWithExports())
{
return 0;
}
......@@ -4720,7 +4720,7 @@ cmGeneratorTarget::GetLinkInterfaceLibraries(const std::string& config,
// Link interfaces are not supported for executables that do not
// export symbols.
if(this->GetType() == cmState::EXECUTABLE &&
!this->Target->IsExecutableWithExports())
!this->IsExecutableWithExports())
{
return 0;
}
......@@ -5031,7 +5031,7 @@ cmGeneratorTarget::ComputeLinkInterfaceLibraries(
explicitLibraries = this->GetProperty(linkIfaceProp);
}
else if(this->GetType() == cmState::SHARED_LIBRARY ||
this->Target->IsExecutableWithExports())
this->IsExecutableWithExports())
{
// CMP0022 OLD behavior is to use LINK_INTERFACE_LIBRARIES if set on a
// shared lib or executable.
......@@ -5350,7 +5350,7 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
info.ImportLibrary = imp;
}
else if(this->GetType() == cmState::SHARED_LIBRARY ||
this->Target->IsExecutableWithExports())
this->IsExecutableWithExports())
{
std::string impProp = "IMPORTED_IMPLIB";
impProp += suffix;
......@@ -5858,7 +5858,7 @@ cmGeneratorTarget::FindTargetToLink(std::string const& name) const
// name conflict between an external library and an executable
// within the project.
if(tgt && tgt->GetType() == cmState::EXECUTABLE &&
!tgt->Target->IsExecutableWithExports())
!tgt->IsExecutableWithExports())
{
tgt = 0;
}
......@@ -5913,12 +5913,19 @@ bool cmGeneratorTarget::GetImplibGNUtoMS(std::string const& gnuName,
return false;
}
//----------------------------------------------------------------------------
bool cmGeneratorTarget::IsExecutableWithExports() const
{
return (this->GetType() == cmState::EXECUTABLE &&
this->GetPropertyAsBool("ENABLE_EXPORTS"));
}
//----------------------------------------------------------------------------
bool cmGeneratorTarget::HasImportLibrary() const
{
return (this->Target->IsDLLPlatform() &&
(this->GetType() == cmState::SHARED_LIBRARY ||
this->Target->IsExecutableWithExports()));
this->IsExecutableWithExports()));
}
//----------------------------------------------------------------------------
......@@ -5944,7 +5951,7 @@ bool cmGeneratorTarget::IsLinkable() const
this->GetType() == cmState::MODULE_LIBRARY ||
this->GetType() == cmState::UNKNOWN_LIBRARY ||
this->GetType() == cmState::INTERFACE_LIBRARY ||
this->Target->IsExecutableWithExports());
this->IsExecutableWithExports());
}
//----------------------------------------------------------------------------
......
......@@ -406,6 +406,8 @@ public:
bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out,
const char* newExt = 0) const;
bool IsExecutableWithExports() const;
/** Return whether or not the target has a DLL import library. */
bool HasImportLibrary() const;
......
......@@ -1444,7 +1444,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
this->Makefile->GetSafeDefinition("CMAKE_CREATE_CONSOLE_EXE");
linkFlags += " ";
}
if (target->Target->IsExecutableWithExports())
if (target->IsExecutableWithExports())
{
std::string exportFlagVar = "CMAKE_EXE_EXPORTS_";
exportFlagVar += linkLanguage;
......@@ -2106,7 +2106,7 @@ void cmLocalGenerator
std::string *pWarnCMP0063 = 0;
if (target->GetType() != cmState::SHARED_LIBRARY &&
target->GetType() != cmState::MODULE_LIBRARY &&
!target->Target->IsExecutableWithExports())
!target->IsExecutableWithExports())
{
switch (target->Target->GetPolicyStatusCMP0063())
{
......
......@@ -209,7 +209,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
}
// Add symbol export flags if necessary.
if(this->Target->IsExecutableWithExports())
if(this->GeneratorTarget->IsExecutableWithExports())
{
std::string export_flag_var = "CMAKE_EXE_EXPORTS_";
export_flag_var += linkLanguage;
......@@ -297,7 +297,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
std::string linkRule = this->GetLinkRule(linkRuleVar);
std::vector<std::string> commands1;
cmSystemTools::ExpandListArgument(linkRule, real_link_commands);
if(this->Target->IsExecutableWithExports())
if(this->GeneratorTarget->IsExecutableWithExports())
{
// If a separate rule for creating an import library is specified
// add it now.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment