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 c969d4628bff6c5b45c788d3a61fff85c36272f6 (commit) via e0f735f8f53543773f01a4f692609d1b23fd3621 (commit) via 0962589627f9bb3399d8144fc8252e47484bc0b3 (commit) via d75cad01f0a43c55f999768fb63287fc247f9685 (commit) via 4b2e1fc9eeeb0b0b686b2e38a2a29e49eedb45e5 (commit) via 94648953befa6464e46469b1fa8d46b68d486321 (commit) from 26a3bccb60b1ba97b528187c244acf4c3bbceb3e (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=c969d4628bff6c5b45c788d3a61fff85c36272f6 commit c969d4628bff6c5b45c788d3a61fff85c36272f6 Merge: e0f735f 0962589 Author: Brad King <brad.k...@kitware.com> AuthorDate: Mon Aug 5 14:40:21 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Mon Aug 5 10:40:46 2019 -0400 Merge topic 'cleanup_cmake_constructor' 0962589627 cmake: Initialize booleans at declaration and cleanup constructor Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3646 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e0f735f8f53543773f01a4f692609d1b23fd3621 commit e0f735f8f53543773f01a4f692609d1b23fd3621 Merge: 26a3bcc d75cad0 Author: Brad King <brad.k...@kitware.com> AuthorDate: Mon Aug 5 14:37:30 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Mon Aug 5 10:37:47 2019 -0400 Merge topic 'shared-deps-no-iface' d75cad01f0 Fix rpath-link for shared lib with only private deps 4b2e1fc9ee cmGeneratorTarget: Use local var to de-duplicate CMP0022 checks 94648953be cmLinkItem: Simplify tracking of whether link interface is explicit Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3642 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0962589627f9bb3399d8144fc8252e47484bc0b3 commit 0962589627f9bb3399d8144fc8252e47484bc0b3 Author: Sebastian Holtermann <sebh...@xwmw.org> AuthorDate: Fri Aug 2 11:43:35 2019 +0200 Commit: Sebastian Holtermann <sebh...@xwmw.org> CommitDate: Sat Aug 3 11:44:38 2019 +0200 cmake: Initialize booleans at declaration and cleanup constructor diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 309efd3..a81b7e4 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -28,6 +28,7 @@ #include "cmUtils.hxx" #include "cmVersionConfig.h" #include "cmWorkingDirectory.h" +#include "cm_string_view.hxx" #include "cm_sys_stat.h" #if defined(CMAKE_BUILD_WITH_CMAKE) @@ -132,22 +133,15 @@ static void cmWarnUnusedCliWarning(const std::string& variable, int /*unused*/, } cmake::cmake(Role role, cmState::Mode mode) + : FileTimeCache(cm::make_unique<cmFileTimeCache>()) +#ifdef CMAKE_BUILD_WITH_CMAKE + , VariableWatch(cm::make_unique<cmVariableWatch>()) +#endif + , State(cm::make_unique<cmState>()) + , Messenger(cm::make_unique<cmMessenger>()) { - this->Trace = false; - this->TraceExpand = false; - this->WarnUninitialized = false; - this->WarnUnused = false; - this->WarnUnusedCli = true; - this->CheckSystemVars = false; - this->DebugOutput = false; - this->DebugTryCompile = false; - this->ClearBuildSystem = false; - this->FileTimeCache = cm::make_unique<cmFileTimeCache>(); - - this->State = cm::make_unique<cmState>(); this->State->SetMode(mode); this->CurrentSnapshot = this->State->CreateBaseSnapshot(); - this->Messenger = cm::make_unique<cmMessenger>(); #ifdef __APPLE__ struct rlimit rlp; @@ -159,16 +153,6 @@ cmake::cmake(Role role, cmState::Mode mode) } #endif - this->GlobalGenerator = nullptr; - this->GeneratorInstanceSet = false; - this->GeneratorPlatformSet = false; - this->GeneratorToolsetSet = false; - this->CurrentWorkingMode = NORMAL_MODE; - -#ifdef CMAKE_BUILD_WITH_CMAKE - this->VariableWatch = cm::make_unique<cmVariableWatch>(); -#endif - this->AddDefaultGenerators(); this->AddDefaultExtraGenerators(); if (role == RoleScript || role == RoleProject) { @@ -188,32 +172,25 @@ cmake::cmake(Role role, cmState::Mode mode) // Set up a list of source and header extensions. // These are used to find files when the extension is not given. { - auto fillExts = [](FileExtensions& exts, - std::initializer_list<const char*> extList) { + auto setupExts = [](FileExtensions& exts, + std::initializer_list<cm::string_view> extList) { // Fill ordered vector exts.ordered.reserve(extList.size()); - for (const char* ext : extList) { + for (cm::string_view ext : extList) { exts.ordered.emplace_back(ext); }; // Fill unordered set exts.unordered.insert(exts.ordered.begin(), exts.ordered.end()); }; - // Source extensions // The "c" extension MUST precede the "C" extension. - fillExts(this->SourceFileExtensions, - { "c", "C", "c++", "cc", "cpp", "cxx", "cu", "m", "M", "mm" }); - - // Header extensions - fillExts(this->HeaderFileExtensions, - { "h", "hh", "h++", "hm", "hpp", "hxx", "in", "txx" }); - - // Cuda extensions - fillExts(this->CudaFileExtensions, { "cu" }); - - // Fortran extensions - fillExts(this->FortranFileExtensions, - { "f", "F", "for", "f77", "f90", "f95", "f03" }); + setupExts(this->SourceFileExtensions, + { "c", "C", "c++", "cc", "cpp", "cxx", "cu", "m", "M", "mm" }); + setupExts(this->HeaderFileExtensions, + { "h", "hh", "h++", "hm", "hpp", "hxx", "in", "txx" }); + setupExts(this->CudaFileExtensions, { "cu" }); + setupExts(this->FortranFileExtensions, + { "f", "F", "for", "f77", "f90", "f95", "f03" }); } } diff --git a/Source/cmake.h b/Source/cmake.h index 6aa00e1..92494ae 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -509,14 +509,14 @@ protected: void AddDefaultGenerators(); void AddDefaultExtraGenerators(); - cmGlobalGenerator* GlobalGenerator; + cmGlobalGenerator* GlobalGenerator = nullptr; std::map<std::string, DiagLevel> DiagLevels; std::string GeneratorInstance; std::string GeneratorPlatform; std::string GeneratorToolset; - bool GeneratorInstanceSet; - bool GeneratorPlatformSet; - bool GeneratorToolsetSet; + bool GeneratorInstanceSet = false; + bool GeneratorPlatformSet = false; + bool GeneratorToolsetSet = false; //! read in a cmake list file to initialize the cache void ReadListFile(const std::vector<std::string>& args, @@ -543,14 +543,14 @@ protected: private: ProgressCallbackType ProgressCallback; - WorkingMode CurrentWorkingMode; - bool DebugOutput; - bool Trace; - bool TraceExpand; - bool WarnUninitialized; - bool WarnUnused; - bool WarnUnusedCli; - bool CheckSystemVars; + WorkingMode CurrentWorkingMode = NORMAL_MODE; + bool DebugOutput = false; + bool Trace = false; + bool TraceExpand = false; + bool WarnUninitialized = false; + bool WarnUnused = false; + bool WarnUnusedCli = true; + bool CheckSystemVars = false; std::map<std::string, bool> UsedCliVariables; std::string CMakeEditCommand; std::string CXXEnvironment; @@ -564,8 +564,8 @@ private: FileExtensions HeaderFileExtensions; FileExtensions CudaFileExtensions; FileExtensions FortranFileExtensions; - bool ClearBuildSystem; - bool DebugTryCompile; + bool ClearBuildSystem = false; + bool DebugTryCompile = false; std::unique_ptr<cmFileTimeCache> FileTimeCache; std::string GraphVizFile; InstalledFilesMap InstalledFiles; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d75cad01f0a43c55f999768fb63287fc247f9685 commit d75cad01f0a43c55f999768fb63287fc247f9685 Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Aug 2 14:50:43 2019 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Fri Aug 2 14:50:57 2019 -0400 Fix rpath-link for shared lib with only private deps Under CMP0022 NEW behavior, the link interface is explicit even if there are no public dependencies (`INTERFACE_LINK_LIBRARIES` is not set). Mark it as such to activate our tracking of private runtime dependencies of shared libraries for generation of `-rpath-link` flags. Fixes: #19556 diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 747051d..d9e5e71 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -5660,7 +5660,7 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries( return; } iface.Exists = true; - iface.Explicit = explicitLibraries != nullptr; + iface.Explicit = cmp0022NEW || explicitLibraries != nullptr; if (explicitLibraries) { // The interface libraries have been explicitly set. diff --git a/Tests/RuntimePath/CMakeLists.txt b/Tests/RuntimePath/CMakeLists.txt index 6583a87..bb87440 100644 --- a/Tests/RuntimePath/CMakeLists.txt +++ b/Tests/RuntimePath/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required (VERSION 3.15) project(RuntimePath C) # Add a simple chain of shared libraries that must be found. @@ -31,3 +31,14 @@ if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG) set_property(TARGET bar2 PROPERTY LIBRARY_OUTPUT_DIRECTORY A) target_link_libraries(bar2 foo2) endif() + +# Add a library that is missing the rpath for its dependency. +add_library(bar1_no_rpath SHARED bar1.c) +set_property(TARGET bar1_no_rpath PROPERTY LIBRARY_OUTPUT_DIRECTORY B) +set_property(TARGET bar1_no_rpath PROPERTY SKIP_BUILD_RPATH 1) +target_link_libraries(bar1_no_rpath PRIVATE foo1) + +# Add an executable linking to the library with a missing dependency rpath. +# CMake should generate the proper rpath-link flag to find it at build time. +add_executable(main_with_bar1_no_rpath main.c) +target_link_libraries(main_with_bar1_no_rpath bar1_no_rpath) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4b2e1fc9eeeb0b0b686b2e38a2a29e49eedb45e5 commit 4b2e1fc9eeeb0b0b686b2e38a2a29e49eedb45e5 Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Aug 2 14:47:33 2019 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Fri Aug 2 14:48:34 2019 -0400 cmGeneratorTarget: Use local var to de-duplicate CMP0022 checks diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 42683db..747051d 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -5603,8 +5603,9 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries( // libraries and executables that export symbols. const char* explicitLibraries = nullptr; std::string linkIfaceProp; - if (this->GetPolicyStatusCMP0022() != cmPolicies::OLD && - this->GetPolicyStatusCMP0022() != cmPolicies::WARN) { + bool const cmp0022NEW = (this->GetPolicyStatusCMP0022() != cmPolicies::OLD && + this->GetPolicyStatusCMP0022() != cmPolicies::WARN); + if (cmp0022NEW) { // CMP0022 NEW behavior is to use INTERFACE_LINK_LIBRARIES. linkIfaceProp = "INTERFACE_LINK_LIBRARIES"; explicitLibraries = this->GetProperty(linkIfaceProp); @@ -5666,8 +5667,7 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries( this->ExpandLinkItems(linkIfaceProp, explicitLibraries, config, headTarget, usage_requirements_only, iface.Libraries, iface.HadHeadSensitiveCondition); - } else if (this->GetPolicyStatusCMP0022() == cmPolicies::WARN || - this->GetPolicyStatusCMP0022() == cmPolicies::OLD) + } else if (!cmp0022NEW) // If CMP0022 is NEW then the plain tll signature sets the // INTERFACE_LINK_LIBRARIES, so if we get here then the project // cleared the property explicitly and we should not fall back https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=94648953befa6464e46469b1fa8d46b68d486321 commit 94648953befa6464e46469b1fa8d46b68d486321 Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Aug 2 14:42:14 2019 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Fri Aug 2 14:43:16 2019 -0400 cmLinkItem: Simplify tracking of whether link interface is explicit We now only need a boolean. diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 7340bc2..42683db 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -5219,7 +5219,7 @@ void cmGeneratorTarget::ComputeLinkInterface( const std::string& config, cmOptionalLinkInterface& iface, cmGeneratorTarget const* headTarget) const { - if (iface.ExplicitLibraries) { + if (iface.Explicit) { if (this->GetType() == cmStateEnums::SHARED_LIBRARY || this->GetType() == cmStateEnums::STATIC_LIBRARY || this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { @@ -5659,7 +5659,7 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries( return; } iface.Exists = true; - iface.ExplicitLibraries = explicitLibraries; + iface.Explicit = explicitLibraries != nullptr; if (explicitLibraries) { // The interface libraries have been explicitly set. diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h index 6450c62..d71ff49 100644 --- a/Source/cmLinkItem.h +++ b/Source/cmLinkItem.h @@ -87,7 +87,7 @@ struct cmOptionalLinkInterface : public cmLinkInterface bool LibrariesDone = false; bool AllDone = false; bool Exists = false; - const char* ExplicitLibraries = nullptr; + bool Explicit = false; }; struct cmHeadToLinkInterfaceMap ----------------------------------------------------------------------- Summary of changes: Source/cmGeneratorTarget.cxx | 12 ++++----- Source/cmLinkItem.h | 2 +- Source/cmake.cxx | 57 ++++++++++++---------------------------- Source/cmake.h | 28 ++++++++++---------- Tests/RuntimePath/CMakeLists.txt | 13 ++++++++- 5 files changed, 50 insertions(+), 62 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org https://cmake.org/mailman/listinfo/cmake-commits