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