diff options
author | Deniz Bahadir <dbahadir@benocs.com> | 2020-11-30 23:25:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-12-01 12:35:17 (GMT) |
commit | 38bcb5c0a3accd2dd29fb7632c6b3bf31b990d82 (patch) | |
tree | f7d364b671663d4da35cbb17131e58a84a7c54f1 /Source/cmInstallCommand.cxx | |
parent | 5ef23640535dfd6543bd81c86282e38122169af6 (diff) | |
download | CMake-38bcb5c0a3accd2dd29fb7632c6b3bf31b990d82.zip CMake-38bcb5c0a3accd2dd29fb7632c6b3bf31b990d82.tar.gz CMake-38bcb5c0a3accd2dd29fb7632c6b3bf31b990d82.tar.bz2 |
export: Do not fail generation for separate namelink only case
Update the change from commit 64690f6df0 (export: Do not fail generation
for namelink-only case, 2020-10-09, v3.19.0-rc1~7^2) to also handle
separate namelink-only and namelink-skip calls.
Fixes: #21529
Diffstat (limited to 'Source/cmInstallCommand.cxx')
-rw-r--r-- | Source/cmInstallCommand.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index b99e6a3..ff08ee4 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -461,6 +461,13 @@ bool HandleTargetsMode(std::vector<std::string> const& args, std::unique_ptr<cmInstallFilesGenerator> publicHeaderGenerator; std::unique_ptr<cmInstallFilesGenerator> resourceGenerator; + // Avoid selecting default destinations for PUBLIC_HEADER and + // PRIVATE_HEADER if any artifacts are specified. + bool artifactsSpecified = false; + + // Track whether this is a namelink-only rule. + bool namelinkOnly = false; + auto addTargetExport = [&]() { // Add this install rule to an export if one was specified. if (!exports.empty()) { @@ -475,20 +482,13 @@ bool HandleTargetsMode(std::vector<std::string> const& args, te->ObjectsGenerator = objectGenerator.get(); te->InterfaceIncludeDirectories = cmJoin(includesArgs.GetIncludeDirs(), ";"); - + te->NamelinkOnly = namelinkOnly; 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; - - // Track whether this is a namelink-only rule. - bool namelinkOnly = false; - switch (target.GetType()) { case cmStateEnums::SHARED_LIBRARY: { // Shared libraries are handled differently on DLL and non-DLL @@ -497,6 +497,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) { + namelinkOnly = true; addTargetExport(); continue; } @@ -529,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) { + namelinkOnly = true; addTargetExport(); continue; } @@ -574,6 +576,7 @@ bool HandleTargetsMode(std::vector<std::string> const& args, if (target.IsFrameworkOnApple()) { // When in namelink only mode skip frameworks. if (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly) { + namelinkOnly = true; addTargetExport(); continue; } |