This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, master has been updated via 8a42cd155f00d9418fa60f995b466fff7c1afaa5 (commit) via 67859b3d79606d0fe37a4e0d9dc40e58236d5b80 (commit) via b08b640926828fc090fd88395502da27dc337203 (commit) via 0b83df71e73956749fd266e9c9c9054a23a957da (commit) via cf821ff3c4b893374a575691f1cd6409ae7e1218 (commit) via 8aa0b63bc68ebd5d7eb3f7a02f9520dac54bf813 (commit) via d3ebef4f708f92cd348232d8629c918a6057e521 (commit) via 27d6e51ae9b57657289a4db6092d8a47472b842e (commit) via 49cfd390075ba1f92aa96bbf3d3510a813e0b068 (commit) from cba6c59e7061b1aac74626a456cc14a094285916 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8a42cd155f00d9418fa60f995b466fff7c1afaa5 commit 8a42cd155f00d9418fa60f995b466fff7c1afaa5 Merge: 67859b3 8aa0b63 Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Jul 2 12:44:37 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Tue Jul 2 08:45:58 2019 -0400 Merge topic 'static' 8aa0b63bc6 Swift: add rules for static linking Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3492 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=67859b3d79606d0fe37a4e0d9dc40e58236d5b80 commit 67859b3d79606d0fe37a4e0d9dc40e58236d5b80 Merge: b08b640 d3ebef4 Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Jul 2 12:44:06 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Tue Jul 2 08:44:54 2019 -0400 Merge topic 'cross_ref_CUDAHOSTCXX_in_CMAKE_CUDA_HOST_COMPILER' d3ebef4f70 CMAKE_CUDA_HOST_COMPILER: Document it takes priority over CUDAHOSTCXX Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3490 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b08b640926828fc090fd88395502da27dc337203 commit b08b640926828fc090fd88395502da27dc337203 Merge: 0b83df7 cf821ff Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Jul 2 12:43:54 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Tue Jul 2 08:44:02 2019 -0400 Merge topic 'deprecate-policy-old' cf821ff3c4 Add deprecation warnings for policies CMP0067 and below Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3502 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0b83df71e73956749fd266e9c9c9054a23a957da commit 0b83df71e73956749fd266e9c9c9054a23a957da Merge: cba6c59 27d6e51 Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Jul 2 12:42:43 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Tue Jul 2 08:42:55 2019 -0400 Merge topic 'double-export-error-message' 27d6e51ae9 Tests: add tests for export set error messages 49cfd39007 cmExportBuildFileGenerator: improve error message Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3486 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cf821ff3c4b893374a575691f1cd6409ae7e1218 commit cf821ff3c4b893374a575691f1cd6409ae7e1218 Author: Brad King <brad.k...@kitware.com> AuthorDate: Mon Jul 1 10:18:02 2019 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Mon Jul 1 10:21:06 2019 -0400 Add deprecation warnings for policies CMP0067 and below The OLD behaviors of all policies are deprecated, but only by documentation. Add an explicit deprecation diagnostic for policies introduced in CMake 3.8 and below to encourage projects to port away from setting policies to OLD. diff --git a/Help/release/dev/deprecate-policy-old.rst b/Help/release/dev/deprecate-policy-old.rst new file mode 100644 index 0000000..440efa9 --- /dev/null +++ b/Help/release/dev/deprecate-policy-old.rst @@ -0,0 +1,8 @@ +deprecate-policy-old +-------------------- + +* An explicit deprecation diagnostic was added for policy ``CMP0067`` + (``CMP0066`` and below were already deprecated). + The :manual:`cmake-policies(7)` manual explains that the OLD behaviors + of all policies are deprecated and that projects should port to the + NEW behaviors. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index e0f69cb..bd98f08 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4300,7 +4300,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, // Deprecate old policies, especially those that require a lot // of code to maintain the old behavior. - if (status == cmPolicies::OLD && id <= cmPolicies::CMP0066 && + if (status == cmPolicies::OLD && id <= cmPolicies::CMP0067 && !(this->GetCMakeInstance()->GetIsInTryCompile() && ( // Policies set by cmCoreTryCompile::TryCompileCode. diff --git a/Tests/RunCMake/try_compile/CMP0067-stderr.txt b/Tests/RunCMake/try_compile/CMP0067-stderr.txt index e2677ed..d955dda 100644 --- a/Tests/RunCMake/try_compile/CMP0067-stderr.txt +++ b/Tests/RunCMake/try_compile/CMP0067-stderr.txt @@ -19,6 +19,17 @@ Call Stack \(most recent call first\): This warning is for project developers. Use -Wno-dev to suppress it. after try_compile with CMP0067 WARN-enabled +CMake Deprecation Warning at CMP0067.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0067 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ before try_compile with CMP0067 OLD after try_compile with CMP0067 OLD before try_compile with CMP0067 NEW https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8aa0b63bc68ebd5d7eb3f7a02f9520dac54bf813 commit 8aa0b63bc68ebd5d7eb3f7a02f9520dac54bf813 Author: Saleem Abdulrasool <compn...@compnerd.org> AuthorDate: Thu Jun 27 21:28:48 2019 -0700 Commit: Saleem Abdulrasool <compn...@compnerd.org> CommitDate: Thu Jun 27 21:28:48 2019 -0700 Swift: add rules for static linking The Swift driver recently learnt how to generate static libraries using the `-static` flag. This enables us to generate proper static libraries with dependency tracking with Swift as well. diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index 6f99c1f..f62f61b 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -70,6 +70,12 @@ if(NOT CMAKE_Swift_LINK_EXECUTABLE) endif() if(NOT CMAKE_Swift_CREATE_STATIC_LIBRARY) + if(CMAKE_Swift_COMPILER_TARGET) + set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -target <CMAKE_Swift_COMPILER_TARGET> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-library -static -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>") + else() + set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-library -static -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>") + endif() + set(CMAKE_Swift_ARCHIVE_CREATE "<CMAKE_AR> crs <TARGET> <OBJECTS>") set(CMAKE_Swift_ARCHIVE_FINISH "") endif() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d3ebef4f708f92cd348232d8629c918a6057e521 commit d3ebef4f708f92cd348232d8629c918a6057e521 Author: Robert Maynard <robert.mayn...@kitware.com> AuthorDate: Thu Jun 27 14:39:24 2019 -0400 Commit: Robert Maynard <robert.mayn...@kitware.com> CommitDate: Thu Jun 27 14:39:24 2019 -0400 CMAKE_CUDA_HOST_COMPILER: Document it takes priority over CUDAHOSTCXX diff --git a/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst b/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst index eea2c4f..6d34c5c 100644 --- a/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst +++ b/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst @@ -4,4 +4,5 @@ CMAKE_CUDA_HOST_COMPILER Executable to use when compiling host code when compiling ``CUDA`` language files. Maps to the ``nvcc -ccbin`` option. Will only be used by CMake on the first configuration to determine a valid host compiler for ``CUDA``. After a valid -host compiler has been found, this value is read-only. +host compiler has been found, this value is read-only. This variable takes +priority over the :envvar:`CUDAHOSTCXX` environment variable. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=27d6e51ae9b57657289a4db6092d8a47472b842e commit 27d6e51ae9b57657289a4db6092d8a47472b842e Author: Ben Boeckel <ben.boec...@kitware.com> AuthorDate: Thu Jun 27 08:50:57 2019 -0400 Commit: Ben Boeckel <ben.boec...@kitware.com> CommitDate: Thu Jun 27 10:57:34 2019 -0400 Tests: add tests for export set error messages diff --git a/Tests/RunCMake/export/DependOnDoubleExport-result.txt b/Tests/RunCMake/export/DependOnDoubleExport-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/export/DependOnDoubleExport-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt b/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt new file mode 100644 index 0000000..b78c7e4 --- /dev/null +++ b/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt @@ -0,0 +1,13 @@ +CMake Error in CMakeLists.txt: + export called with target "exported" which requires target "doubleexported" + that is not in this export set, but in multiple other export sets: + .*/Tests/RunCMake/export/DependOnDoubleExport-build/exportset.cmake, + .*/Tests/RunCMake/export/DependOnDoubleExport-build/manual.cmake. + + + An exported target cannot depend upon another target which is exported + multiple times. Consider consolidating the exports of the "doubleexported" + target to a single export. + + +CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/export/DependOnDoubleExport.cmake b/Tests/RunCMake/export/DependOnDoubleExport.cmake new file mode 100644 index 0000000..8d108d7 --- /dev/null +++ b/Tests/RunCMake/export/DependOnDoubleExport.cmake @@ -0,0 +1,7 @@ +add_library(doubleexported INTERFACE) +install(TARGETS doubleexported EXPORT exportset) +export(TARGETS doubleexported FILE "${CMAKE_CURRENT_BINARY_DIR}/manual.cmake") +export(EXPORT exportset FILE "${CMAKE_CURRENT_BINARY_DIR}/exportset.cmake") +add_library(exported INTERFACE) +target_link_libraries(exported INTERFACE doubleexported) +export(TARGETS exported FILE "${CMAKE_CURRENT_BINARY_DIR}/exports.cmake") diff --git a/Tests/RunCMake/export/DependOnNotExport-result.txt b/Tests/RunCMake/export/DependOnNotExport-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/export/DependOnNotExport-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/export/DependOnNotExport-stderr.txt b/Tests/RunCMake/export/DependOnNotExport-stderr.txt new file mode 100644 index 0000000..80f5758 --- /dev/null +++ b/Tests/RunCMake/export/DependOnNotExport-stderr.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + export called with target "exported" which requires target "notexported" + that is not in any export set. + + +CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/export/DependOnNotExport.cmake b/Tests/RunCMake/export/DependOnNotExport.cmake new file mode 100644 index 0000000..06c1ad9 --- /dev/null +++ b/Tests/RunCMake/export/DependOnNotExport.cmake @@ -0,0 +1,4 @@ +add_library(notexported INTERFACE) +add_library(exported INTERFACE) +target_link_libraries(exported INTERFACE notexported) +export(TARGETS exported FILE "${CMAKE_CURRENT_BINARY_DIR}/exports.cmake") diff --git a/Tests/RunCMake/export/RunCMakeTest.cmake b/Tests/RunCMake/export/RunCMakeTest.cmake index 97a0ca6..4d2f217 100644 --- a/Tests/RunCMake/export/RunCMakeTest.cmake +++ b/Tests/RunCMake/export/RunCMakeTest.cmake @@ -10,3 +10,5 @@ run_cmake(ForbiddenToExportInterfaceProperties) run_cmake(ForbiddenToExportImportedProperties) run_cmake(ForbiddenToExportPropertyWithGenExp) run_cmake(ExportPropertiesUndefined) +run_cmake(DependOnNotExport) +run_cmake(DependOnDoubleExport) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=49cfd390075ba1f92aa96bbf3d3510a813e0b068 commit 49cfd390075ba1f92aa96bbf3d3510a813e0b068 Author: Ben Boeckel <ben.boec...@kitware.com> AuthorDate: Wed Jun 26 13:48:59 2019 -0400 Commit: Ben Boeckel <ben.boec...@kitware.com> CommitDate: Thu Jun 27 10:57:34 2019 -0400 cmExportBuildFileGenerator: improve error message When an exported target depends on another exported target that is included in multiple build export sets, the error message was woefully unhelpful. Now, include information about what build exports the dependent target was included in with instructions for fixing the problem that are actually helpful. diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 3fe84a9..5800629 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -12,7 +12,6 @@ #include "cmMessageType.h" #include "cmPolicies.h" #include "cmStateTypes.h" -#include "cmSystemTools.h" #include "cmTarget.h" #include "cmTargetExport.h" #include "cmake.h" @@ -259,11 +258,11 @@ void cmExportBuildFileGenerator::HandleMissingTarget( const std::string name = dependee->GetName(); cmGlobalGenerator* gg = dependee->GetLocalGenerator()->GetGlobalGenerator(); - std::vector<std::string> namespaces = this->FindNamespaces(gg, name); + auto exportInfo = this->FindBuildExportInfo(gg, name); + std::vector<std::string> const& exportFiles = exportInfo.first; - int targetOccurrences = static_cast<int>(namespaces.size()); - if (targetOccurrences == 1) { - std::string missingTarget = namespaces[0]; + if (exportFiles.size() == 1) { + std::string missingTarget = exportInfo.second; missingTarget += dependee->GetExportName(); link_libs += missingTarget; @@ -272,7 +271,7 @@ void cmExportBuildFileGenerator::HandleMissingTarget( } // We are not appending, so all exported targets should be // known here. This is probably user-error. - this->ComplainAboutMissingTarget(depender, dependee, targetOccurrences); + this->ComplainAboutMissingTarget(depender, dependee, exportFiles); } // Assume the target will be exported by another command. // Append it with the export namespace. @@ -292,10 +291,12 @@ void cmExportBuildFileGenerator::GetTargets( targets = this->Targets; } -std::vector<std::string> cmExportBuildFileGenerator::FindNamespaces( - cmGlobalGenerator* gg, const std::string& name) +std::pair<std::vector<std::string>, std::string> +cmExportBuildFileGenerator::FindBuildExportInfo(cmGlobalGenerator* gg, + const std::string& name) { - std::vector<std::string> namespaces; + std::vector<std::string> exportFiles; + std::string ns; std::map<std::string, cmExportBuildFileGenerator*>& exportSets = gg->GetBuildExportSets(); @@ -305,31 +306,31 @@ std::vector<std::string> cmExportBuildFileGenerator::FindNamespaces( std::vector<std::string> targets; exportSet->GetTargets(targets); if (std::find(targets.begin(), targets.end(), name) != targets.end()) { - namespaces.push_back(exportSet->GetNamespace()); + exportFiles.push_back(exp.first); + ns = exportSet->GetNamespace(); } } - return namespaces; + return std::make_pair(exportFiles, ns); } void cmExportBuildFileGenerator::ComplainAboutMissingTarget( - cmGeneratorTarget* depender, cmGeneratorTarget* dependee, int occurrences) + cmGeneratorTarget* depender, cmGeneratorTarget* dependee, + std::vector<std::string> const& exportFiles) { - if (cmSystemTools::GetErrorOccuredFlag()) { - return; - } - std::ostringstream e; e << "export called with target \"" << depender->GetName() << "\" which requires target \"" << dependee->GetName() << "\" "; - if (occurrences == 0) { - e << "that is not in the export set.\n"; + if (exportFiles.empty()) { + e << "that is not in any export set."; } else { - e << "that is not in this export set, but " << occurrences - << " times in others.\n"; + e << "that is not in this export set, but in multiple other export sets: " + << cmJoin(exportFiles, ", ") << ".\n"; + e << "An exported target cannot depend upon another target which is " + "exported multiple times. Consider consolidating the exports of the " + "\"" + << dependee->GetName() << "\" target to a single export."; } - e << "If the required target is not easy to reference in this call, " - << "consider using the APPEND option with multiple separate calls."; this->LG->GetGlobalGenerator()->GetCMakeInstance()->IssueMessage( MessageType::FATAL_ERROR, e.str(), diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h index 0a1e755..e5b6597 100644 --- a/Source/cmExportBuildFileGenerator.h +++ b/Source/cmExportBuildFileGenerator.h @@ -11,6 +11,7 @@ #include <iosfwd> #include <string> +#include <utility> #include <vector> class cmExportSet; @@ -64,7 +65,7 @@ protected: void ComplainAboutMissingTarget(cmGeneratorTarget* depender, cmGeneratorTarget* dependee, - int occurrences); + std::vector<std::string> const& namespaces); /** Fill in properties indicating built file locations. */ void SetImportLocationProperty(const std::string& config, @@ -75,8 +76,8 @@ protected: std::string InstallNameDir(cmGeneratorTarget* target, const std::string& config) override; - std::vector<std::string> FindNamespaces(cmGlobalGenerator* gg, - const std::string& name); + std::pair<std::vector<std::string>, std::string> FindBuildExportInfo( + cmGlobalGenerator* gg, const std::string& name); std::vector<std::string> Targets; cmExportSet* ExportSet; ----------------------------------------------------------------------- Summary of changes: Help/release/dev/deprecate-policy-old.rst | 8 ++++ Help/variable/CMAKE_CUDA_HOST_COMPILER.rst | 3 +- Modules/CMakeSwiftInformation.cmake | 6 +++ Source/cmExportBuildFileGenerator.cxx | 45 +++++++++++----------- Source/cmExportBuildFileGenerator.h | 7 ++-- Source/cmMakefile.cxx | 2 +- .../DependOnDoubleExport-result.txt} | 0 .../export/DependOnDoubleExport-stderr.txt | 13 +++++++ Tests/RunCMake/export/DependOnDoubleExport.cmake | 7 ++++ .../DependOnNotExport-result.txt} | 0 Tests/RunCMake/export/DependOnNotExport-stderr.txt | 6 +++ Tests/RunCMake/export/DependOnNotExport.cmake | 4 ++ Tests/RunCMake/export/RunCMakeTest.cmake | 2 + Tests/RunCMake/try_compile/CMP0067-stderr.txt | 11 ++++++ 14 files changed, 87 insertions(+), 27 deletions(-) create mode 100644 Help/release/dev/deprecate-policy-old.rst copy Tests/RunCMake/{while/MissingArgument-result.txt => export/DependOnDoubleExport-result.txt} (100%) create mode 100644 Tests/RunCMake/export/DependOnDoubleExport-stderr.txt create mode 100644 Tests/RunCMake/export/DependOnDoubleExport.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => export/DependOnNotExport-result.txt} (100%) create mode 100644 Tests/RunCMake/export/DependOnNotExport-stderr.txt create mode 100644 Tests/RunCMake/export/DependOnNotExport.cmake hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org https://cmake.org/mailman/listinfo/cmake-commits