diff options
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | CONTRIBUTING.rst | 4 | ||||
-rw-r--r-- | Modules/FindXercesC.cmake | 8 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CPack/cmCPackProductBuildGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmFindPackageCommand.h | 5 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 49 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 7 | ||||
-rw-r--r-- | Source/cmServerProtocol.cxx | 1 | ||||
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 24 | ||||
-rw-r--r-- | Utilities/IWYU/mapping.imp | 2 |
11 files changed, 64 insertions, 45 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e20d770..1fcd8f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -285,7 +285,8 @@ if(CMake_RUN_IWYU) message(FATAL_ERROR "CMake_RUN_IWYU is ON but include-what-you-use is not found!") endif() set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE - "${IWYU_COMMAND};-Xiwyu;--mapping_file=${CMake_SOURCE_DIR}/Utilities/IWYU/mapping.imp;-w;-DCMAKE_IWYU") + "${IWYU_COMMAND};-Xiwyu;--mapping_file=${CMake_SOURCE_DIR}/Utilities/IWYU/mapping.imp;-w") + list(APPEND CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${CMake_IWYU_OPTIONS}) endif() diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 9e67703..84f6abb 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -36,7 +36,9 @@ To contribute patches: #. Push a topic branch to a personal repository fork on GitLab. #. Create a GitLab Merge Request targeting the upstream ``master`` branch (even if the change is intended for merge to the ``release`` branch). - Check the box to allow edits from maintainers. + Check the box labelled "Allow commits from members who can merge to the + target branch". This will allow maintainers to make minor edits on your + behalf. The merge request will enter the `CMake Review Process`_ for consideration. diff --git a/Modules/FindXercesC.cmake b/Modules/FindXercesC.cmake index 267c164..55db7ae 100644 --- a/Modules/FindXercesC.cmake +++ b/Modules/FindXercesC.cmake @@ -73,6 +73,10 @@ find_path(XercesC_INCLUDE_DIR DOC "Xerces-C++ include directory") mark_as_advanced(XercesC_INCLUDE_DIR) +if(XercesC_INCLUDE_DIR) + _XercesC_GET_VERSION("${XercesC_INCLUDE_DIR}/xercesc/util/XercesVersion.hpp") +endif() + if(NOT XercesC_LIBRARY) # Find all XercesC libraries find_library(XercesC_LIBRARY_RELEASE @@ -90,10 +94,6 @@ unset(XercesC_VERSION_MAJOR) unset(XercesC_VERSION_MINOR) unset(XercesC_VERSION_PATCH) -if(XercesC_INCLUDE_DIR) - _XercesC_GET_VERSION("${XercesC_INCLUDE_DIR}/xercesc/util/XercesVersion.hpp") -endif() - include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(XercesC FOUND_VAR XercesC_FOUND diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 209769e..d8f56f6 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 12) -set(CMake_VERSION_PATCH 20180806) +set(CMake_VERSION_PATCH 20180809) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx index 4ca0fa8..76b3275 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.cxx +++ b/Source/CPack/cmCPackProductBuildGenerator.cxx @@ -144,10 +144,10 @@ bool cmCPackProductBuildGenerator::RunProductBuild(const std::string& command) tmpFile += "/ProductBuildOutput.log"; cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << command << std::endl); - std::string output, error_output; + std::string output; int retVal = 1; bool res = cmSystemTools::RunSingleCommand( - command.c_str(), &output, &error_output, &retVal, nullptr, + command.c_str(), &output, &output, &retVal, nullptr, this->GeneratorVerbose, cmDuration::zero()); cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Done running command" << std::endl); if (!res || retVal) { diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h index d8c7ab3..48f17ef 100644 --- a/Source/cmFindPackageCommand.h +++ b/Source/cmFindPackageCommand.h @@ -7,6 +7,7 @@ #include "cm_kwiml.h" #include <cstddef> +#include <functional> #include <map> #include <set> #include <string> @@ -15,14 +16,12 @@ // IWYU insists we should forward-declare instead of including <functional>, // but we cannot forward-declare reliably because some C++ standard libraries // put the template in an inline namespace. -#ifdef CMAKE_IWYU +#ifdef CMAKE_IWYU_FORWARD_STD_HASH /* clang-format off */ namespace std { template <class T> struct hash; } /* clang-format on */ -#else -# include <functional> #endif #include "cmFindCommon.h" diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 63bbf04..58821c2 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1313,16 +1313,10 @@ bool cmGlobalGenerator::Compute() // so create the map from project name to vector of local generators this->FillProjectMap(); -#ifdef CMAKE_BUILD_WITH_CMAKE - // Iterate through all targets and set up automoc for those which have - // the AUTOMOC, AUTOUIC or AUTORCC property set - auto autogenInits = this->CreateQtAutoGenInitializers(); - for (auto& autoGen : autogenInits) { - if (!autoGen->InitCustomTargets()) { - return false; - } + // Iterate through all targets and set up AUTOMOC, AUTOUIC and AUTORCC + if (!this->QtAutoGen()) { + return false; } -#endif // Add generator specific helper commands for (cmLocalGenerator* localGen : this->LocalGenerators) { @@ -1341,16 +1335,6 @@ bool cmGlobalGenerator::Compute() } } -#ifdef CMAKE_BUILD_WITH_CMAKE - for (auto& autoGen : autogenInits) { - if (!autoGen->SetupCustomTargets()) { - return false; - } - autoGen.reset(nullptr); - } - autogenInits.clear(); -#endif - for (cmLocalGenerator* localGen : this->LocalGenerators) { cmMakefile* mf = localGen->GetMakefile(); for (cmInstallGenerator* g : mf->GetInstallGenerators()) { @@ -1480,12 +1464,11 @@ bool cmGlobalGenerator::ComputeTargetDepends() return true; } -std::vector<std::unique_ptr<cmQtAutoGenInitializer>> -cmGlobalGenerator::CreateQtAutoGenInitializers() +bool cmGlobalGenerator::QtAutoGen() { +#ifdef CMAKE_BUILD_WITH_CMAKE std::vector<std::unique_ptr<cmQtAutoGenInitializer>> autogenInits; -#ifdef CMAKE_BUILD_WITH_CMAKE for (cmLocalGenerator* localGen : this->LocalGenerators) { const std::vector<cmGeneratorTarget*>& targets = localGen->GetGeneratorTargets(); @@ -1519,12 +1502,30 @@ cmGlobalGenerator::CreateQtAutoGenInitializers() continue; } - autogenInits.emplace_back(new cmQtAutoGenInitializer( + autogenInits.emplace_back(cm::make_unique<cmQtAutoGenInitializer>( target, mocEnabled, uicEnabled, rccEnabled, qtVersionMajor)); } } + + if (!autogenInits.empty()) { + // Initialize custom targets + for (auto& autoGen : autogenInits) { + if (!autoGen->InitCustomTargets()) { + return false; + } + } + + // Setup custom targets + for (auto& autoGen : autogenInits) { + if (!autoGen->SetupCustomTargets()) { + return false; + } + autoGen.reset(nullptr); + } + } #endif - return autogenInits; + + return true; } cmLinkLineComputer* cmGlobalGenerator::CreateLinkLineComputer( diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 54dbfc7..1ed070e 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -33,7 +33,6 @@ class cmLinkLineComputer; class cmLocalGenerator; class cmMakefile; class cmOutputConverter; -class cmQtAutoGenInitializer; class cmSourceFile; class cmStateDirectory; class cmake; @@ -443,9 +442,9 @@ protected: virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const; - // Qt auto generators - std::vector<std::unique_ptr<cmQtAutoGenInitializer>> - CreateQtAutoGenInitializers(); + /// @brief Qt AUTOMOC/UIC/RCC target generation + /// @return true on success + bool QtAutoGen(); std::string SelectMakeProgram(const std::string& makeProgram, const std::string& makeDefault = "") const; diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index b05eac4..c267160 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -37,7 +37,6 @@ #include <set> #include <string> #include <unordered_map> -#include <utility> #include <vector> // Get rid of some windows macros: diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index d552d9f..476fe08 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -1197,9 +1197,27 @@ bool SystemTools::FileExists(const std::string& filename) } return access(filename.c_str(), R_OK) == 0; #elif defined(_WIN32) - return ( - GetFileAttributesW(Encoding::ToWindowsExtendedPath(filename).c_str()) != - INVALID_FILE_ATTRIBUTES); + DWORD attr = + GetFileAttributesW(Encoding::ToWindowsExtendedPath(filename).c_str()); + if (attr == INVALID_FILE_ATTRIBUTES) { + return false; + } + + if (attr & FILE_ATTRIBUTE_REPARSE_POINT) { + // Using 0 instead of GENERIC_READ as it allows reading of file attributes + // even if we do not have permission to read the file itself + HANDLE handle = + CreateFileW(Encoding::ToWindowsExtendedPath(filename).c_str(), 0, 0, + NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); + + if (handle == INVALID_HANDLE_VALUE) { + return false; + } + + CloseHandle(handle); + } + + return true; #else // SCO OpenServer 5.0.7/3.2's command has 711 permission. # if defined(_SCO_DS) diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp index 77bb572..5af8b85 100644 --- a/Utilities/IWYU/mapping.imp +++ b/Utilities/IWYU/mapping.imp @@ -53,7 +53,7 @@ #{ symbol: [ "std::pair", private, "<set>", public ] }, # HACK: iwyu wrongly thinks that <system_error> is needed for std::hash - { symbol: [ "std::hash", private, "<utility>", public ] }, + { symbol: [ "std::hash", private, "<functional>", public ] }, # __decay_and_strip is used internally in the C++11 standard library. # IWYU does not classify it as internal and suggests to add <type_traits>. |