From 6abbf81ef2f298e3221ff5e67a1f3c5f23958212 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 14 Dec 2020 13:26:14 +0000 Subject: gentoo resync : 14.12.2020 --- .../cmake-3.19.1-fix-spurious-include-target.patch | 198 +++++++++++++++++++++ ...ake-3.19.1-use-FPHSA-outside-find_package.patch | 40 +++++ 2 files changed, 238 insertions(+) create mode 100644 dev-util/cmake/files/cmake-3.19.1-fix-spurious-include-target.patch create mode 100644 dev-util/cmake/files/cmake-3.19.1-use-FPHSA-outside-find_package.patch (limited to 'dev-util/cmake/files') diff --git a/dev-util/cmake/files/cmake-3.19.1-fix-spurious-include-target.patch b/dev-util/cmake/files/cmake-3.19.1-fix-spurious-include-target.patch new file mode 100644 index 000000000000..1b51cf013fe5 --- /dev/null +++ b/dev-util/cmake/files/cmake-3.19.1-fix-spurious-include-target.patch @@ -0,0 +1,198 @@ +From 38bcb5c0a3accd2dd29fb7632c6b3bf31b990d82 Mon Sep 17 00:00:00 2001 +From: Deniz Bahadir +Date: Tue, 1 Dec 2020 00:25:39 +0100 +Subject: [PATCH] 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 +--- + Source/cmExportBuildFileGenerator.cxx | 3 +++ + Source/cmExportInstallFileGenerator.cxx | 3 +++ + Source/cmInstallCommand.cxx | 19 +++++++++++-------- + Source/cmTargetExport.h | 2 ++ + Tests/RunCMake/export/RunCMakeTest.cmake | 1 + + .../export/SeparateNamelinkExport.cmake | 16 ++++++++++++++++ + .../install/EXPORT-SeparateNamelink.cmake | 19 +++++++++++++++++++ + Tests/RunCMake/install/RunCMakeTest.cmake | 1 + + 8 files changed, 56 insertions(+), 8 deletions(-) + create mode 100644 Tests/RunCMake/export/SeparateNamelinkExport.cmake + create mode 100644 Tests/RunCMake/install/EXPORT-SeparateNamelink.cmake + +diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx +index dd700c5edf..1a31ae4afd 100644 +--- a/Source/cmExportBuildFileGenerator.cxx ++++ b/Source/cmExportBuildFileGenerator.cxx +@@ -288,6 +288,9 @@ void cmExportBuildFileGenerator::GetTargets( + if (this->ExportSet) { + for (std::unique_ptr const& te : + this->ExportSet->GetTargetExports()) { ++ if (te->NamelinkOnly) { ++ continue; ++ } + targets.push_back(te->TargetName); + } + return; +diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx +index 987ec9ea7b..0b9b183d54 100644 +--- a/Source/cmExportInstallFileGenerator.cxx ++++ b/Source/cmExportInstallFileGenerator.cxx +@@ -42,6 +42,9 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) + std::string sep; + for (std::unique_ptr const& te : + this->IEGen->GetExportSet()->GetTargetExports()) { ++ if (te->NamelinkOnly) { ++ continue; ++ } + expectedTargets += sep + this->Namespace + te->Target->GetExportName(); + sep = " "; + if (this->ExportedTargets.insert(te->Target).second) { +diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx +index b99e6a3c6c..ff08ee41ef 100644 +--- a/Source/cmInstallCommand.cxx ++++ b/Source/cmInstallCommand.cxx +@@ -461,6 +461,13 @@ bool HandleTargetsMode(std::vector const& args, + std::unique_ptr publicHeaderGenerator; + std::unique_ptr 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 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 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 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 const& args, + if (target.IsFrameworkOnApple()) { + // When in namelink only mode skip frameworks. + if (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly) { ++ namelinkOnly = true; + addTargetExport(); + continue; + } +diff --git a/Source/cmTargetExport.h b/Source/cmTargetExport.h +index cb4d8dae44..1e38d84923 100644 +--- a/Source/cmTargetExport.h ++++ b/Source/cmTargetExport.h +@@ -31,4 +31,6 @@ public: + cmInstallFilesGenerator* HeaderGenerator; + std::string InterfaceIncludeDirectories; + ///@} ++ ++ bool NamelinkOnly = false; + }; +diff --git a/Tests/RunCMake/export/RunCMakeTest.cmake b/Tests/RunCMake/export/RunCMakeTest.cmake +index 95c8d5cf45..0e6020f0f4 100644 +--- a/Tests/RunCMake/export/RunCMakeTest.cmake ++++ b/Tests/RunCMake/export/RunCMakeTest.cmake +@@ -17,3 +17,4 @@ run_cmake(DependOnNotExport) + run_cmake(DependOnDoubleExport) + run_cmake(UnknownExport) + run_cmake(NamelinkOnlyExport) ++run_cmake(SeparateNamelinkExport) +diff --git a/Tests/RunCMake/export/SeparateNamelinkExport.cmake b/Tests/RunCMake/export/SeparateNamelinkExport.cmake +new file mode 100644 +index 0000000000..b006aea128 +--- /dev/null ++++ b/Tests/RunCMake/export/SeparateNamelinkExport.cmake +@@ -0,0 +1,16 @@ ++enable_language(CXX) ++add_library(foo SHARED empty.cpp) ++install(TARGETS foo EXPORT fooExport ++ RUNTIME DESTINATION bin ++ LIBRARY ++ DESTINATION lib ++ COMPONENT runtime ++ NAMELINK_SKIP ++) ++install(TARGETS foo EXPORT fooExport ++ LIBRARY ++ DESTINATION lib ++ COMPONENT development ++ NAMELINK_ONLY ++) ++export(EXPORT fooExport FILE "${CMAKE_CURRENT_BINARY_DIR}/foo.cmake") +diff --git a/Tests/RunCMake/install/EXPORT-SeparateNamelink.cmake b/Tests/RunCMake/install/EXPORT-SeparateNamelink.cmake +new file mode 100644 +index 0000000000..5c6fa10d18 +--- /dev/null ++++ b/Tests/RunCMake/install/EXPORT-SeparateNamelink.cmake +@@ -0,0 +1,19 @@ ++enable_language(C) ++add_library(foo SHARED empty.c) ++install(TARGETS foo EXPORT fooExport ++ RUNTIME DESTINATION bin ++ LIBRARY ++ DESTINATION lib ++ COMPONENT runtime ++ NAMELINK_SKIP ++) ++install(TARGETS foo EXPORT fooExport ++ LIBRARY ++ DESTINATION lib ++ COMPONENT development ++ NAMELINK_ONLY ++) ++install(EXPORT fooExport ++ DESTINATION "lib/cmake/" ++ FILE "foo.cmake" ++) +diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake +index 5aab88ca80..d64d88b770 100644 +--- a/Tests/RunCMake/install/RunCMakeTest.cmake ++++ b/Tests/RunCMake/install/RunCMakeTest.cmake +@@ -78,6 +78,7 @@ run_cmake(TARGETS-DESTINATION-bad) + run_cmake(EXPORT-OldIFace) + run_cmake(EXPORT-UnknownExport) + run_cmake(EXPORT-NamelinkOnly) ++run_cmake(EXPORT-SeparateNamelink) + run_cmake(CMP0062-OLD) + run_cmake(CMP0062-NEW) + run_cmake(CMP0062-WARN) +-- +GitLab + diff --git a/dev-util/cmake/files/cmake-3.19.1-use-FPHSA-outside-find_package.patch b/dev-util/cmake/files/cmake-3.19.1-use-FPHSA-outside-find_package.patch new file mode 100644 index 000000000000..8cde769ce8f8 --- /dev/null +++ b/dev-util/cmake/files/cmake-3.19.1-use-FPHSA-outside-find_package.patch @@ -0,0 +1,40 @@ +From 14ecf9c2f6edfae4033d9311f79d79d0d07fc1cf Mon Sep 17 00:00:00 2001 +From: Marc Chevrier +Date: Wed, 25 Nov 2020 16:36:12 +0100 +Subject: [PATCH] FPHSA: ensure it can be used outside 'find_package' + +Fixes: #21505 +--- + Modules/FindPackageHandleStandardArgs.cmake | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake +index 7af017136d..7e172779e4 100644 +--- a/Modules/FindPackageHandleStandardArgs.cmake ++++ b/Modules/FindPackageHandleStandardArgs.cmake +@@ -275,8 +275,10 @@ function(FIND_PACKAGE_CHECK_VERSION version result) + unset (${FPCV_RESULT_MESSAGE_VARIABLE} PARENT_SCOPE) + endif() + +- if (CMAKE_FIND_PACKAGE_NAME) +- set (package ${CMAKE_FIND_PACKAGE_NAME}) ++ if (_CMAKE_FPHSA_PACKAGE_NAME) ++ set (package "${_CMAKE_FPHSA_PACKAGE_NAME}") ++ elseif (CMAKE_FIND_PACKAGE_NAME) ++ set (package "${CMAKE_FIND_PACKAGE_NAME}") + else() + message (FATAL_ERROR "find_package_check_version(): Cannot be used outside a 'Find Module'") + endif() +@@ -436,6 +438,9 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) + "will be used.") + endif() + ++ # to propagate package name to FIND_PACKAGE_CHECK_VERSION ++ set(_CMAKE_FPHSA_PACKAGE_NAME "${_NAME}") ++ + # now that we collected all arguments, process them + + if("x${FPHSA_FAIL_MESSAGE}" STREQUAL "xDEFAULT_MSG") +-- +GitLab + -- cgit v1.2.3