mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-22 06:31:29 -06:00
Ninja: Do not use module definition .def files for static libraries
A module definition (`.def`) file specifies symbols to export from a linked binary. The librarian tool is not a linker and so should not be given a `/DEF:...` flag with the `.def` file. The other generators already do not do this, so fix Ninja to be consistent. Closes: #16537
This commit is contained in:
@@ -63,6 +63,13 @@ void cmCommonTargetGenerator::AddFeatureFlags(std::string& flags,
|
|||||||
void cmCommonTargetGenerator::AddModuleDefinitionFlag(
|
void cmCommonTargetGenerator::AddModuleDefinitionFlag(
|
||||||
cmLinkLineComputer* linkLineComputer, std::string& flags)
|
cmLinkLineComputer* linkLineComputer, std::string& flags)
|
||||||
{
|
{
|
||||||
|
// A module definition file only makes sense on certain target types.
|
||||||
|
if (this->GeneratorTarget->GetType() != cmStateEnums::SHARED_LIBRARY &&
|
||||||
|
this->GeneratorTarget->GetType() != cmStateEnums::MODULE_LIBRARY &&
|
||||||
|
this->GeneratorTarget->GetType() != cmStateEnums::EXECUTABLE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!this->ModuleDefinitionFile) {
|
if (!this->ModuleDefinitionFile) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user