diff options
author | Deniz Bahadir <dbahadir@benocs.com> | 2020-10-09 10:13:13 (GMT) |
---|---|---|
committer | Deniz Bahadir <dbahadir@benocs.com> | 2020-10-09 20:29:22 (GMT) |
commit | 64690f6df043b65b083c258b2c53910508336469 (patch) | |
tree | 4200ba898a14d89aaf2950364f47cfce33cdb785 /Source/cmInstallCommand.cxx | |
parent | 3fb2112880ca3be6299721f5add1928483de0b1b (diff) | |
download | CMake-64690f6df043b65b083c258b2c53910508336469.zip CMake-64690f6df043b65b083c258b2c53910508336469.tar.gz CMake-64690f6df043b65b083c258b2c53910508336469.tar.bz2 |
export: Do not fail generation for namelink-only case
Diffstat (limited to 'Source/cmInstallCommand.cxx')
-rw-r--r-- | Source/cmInstallCommand.cxx | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 83609e2..9a5dbef 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -461,6 +461,28 @@ bool HandleTargetsMode(std::vector<std::string> const& args, std::unique_ptr<cmInstallFilesGenerator> publicHeaderGenerator; std::unique_ptr<cmInstallFilesGenerator> resourceGenerator; + auto addTargetExport = [&]() { + // Add this install rule to an export if one was specified. + // (If this is a namelink-only rule no export file will be generated.) + if (!exports.empty()) { + auto te = cm::make_unique<cmTargetExport>(); + te->TargetName = target.GetName(); + te->ArchiveGenerator = archiveGenerator.get(); + te->BundleGenerator = bundleGenerator.get(); + te->FrameworkGenerator = frameworkGenerator.get(); + te->HeaderGenerator = publicHeaderGenerator.get(); + te->LibraryGenerator = libraryGenerator.get(); + te->RuntimeGenerator = runtimeGenerator.get(); + te->ObjectsGenerator = objectGenerator.get(); + te->InterfaceIncludeDirectories = + cmJoin(includesArgs.GetIncludeDirs(), ";"); + + helper.Makefile->GetGlobalGenerator() + ->GetExportSets()[exports] + .AddTargetExport(std::move(te)); + } + }; + // Avoid selecting default destinations for PUBLIC_HEADER and // PRIVATE_HEADER if any artifacts are specified. bool artifactsSpecified = false; @@ -476,6 +498,7 @@ bool HandleTargetsMode(std::vector<std::string> const& args, if (target.IsDLLPlatform()) { // When in namelink only mode skip all libraries on Windows. if (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly) { + addTargetExport(); continue; } @@ -507,6 +530,7 @@ bool HandleTargetsMode(std::vector<std::string> const& args, if (target.IsFrameworkOnApple()) { // When in namelink only mode skip frameworks. if (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly) { + addTargetExport(); continue; } @@ -551,6 +575,7 @@ bool HandleTargetsMode(std::vector<std::string> const& args, if (target.IsFrameworkOnApple()) { // When in namelink only mode skip frameworks. if (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly) { + addTargetExport(); continue; } @@ -744,25 +769,8 @@ bool HandleTargetsMode(std::vector<std::string> const& args, } } - // Add this install rule to an export if one was specified and - // this is not a namelink-only rule. - if (!exports.empty() && !namelinkOnly) { - auto te = cm::make_unique<cmTargetExport>(); - te->TargetName = target.GetName(); - te->ArchiveGenerator = archiveGenerator.get(); - te->BundleGenerator = bundleGenerator.get(); - te->FrameworkGenerator = frameworkGenerator.get(); - te->HeaderGenerator = publicHeaderGenerator.get(); - te->LibraryGenerator = libraryGenerator.get(); - te->RuntimeGenerator = runtimeGenerator.get(); - te->ObjectsGenerator = objectGenerator.get(); - te->InterfaceIncludeDirectories = - cmJoin(includesArgs.GetIncludeDirs(), ";"); - - helper.Makefile->GetGlobalGenerator() - ->GetExportSets()[exports] - .AddTargetExport(std::move(te)); - } + // Add this install rule to an export if one was specified. + addTargetExport(); // Keep track of whether we're installing anything in each category installsArchive = installsArchive || archiveGenerator; |