mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-24 07:08:38 -05:00
Merge topic 'c++11-iwyu'
50dd15afQtDialog: block include-what-you-usef3e21613cmServer: include what you use9535823bIWYU: map system symbols to libuv6a91ee02IWYU: add mapping for cm::auto_ptr7165065fcmInstalledFile: add cmConfigure.h as first #include Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !811
This commit is contained in:
@@ -160,6 +160,12 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS} ${MANIFEST_FILE})
|
||||
target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${CMake_QT_LIBRARIES})
|
||||
|
||||
# cmake-gui has not been updated for `include-what-you-use`.
|
||||
# Block the tool until this is done.
|
||||
set_target_properties(cmake-gui PROPERTIES
|
||||
CXX_INCLUDE_WHAT_YOU_USE ""
|
||||
)
|
||||
|
||||
# Files generated by MOC, RCC, and UIC may produce clang-tidy warnings.
|
||||
# We generate a dummy .clang-tidy file in the binary directory that disables
|
||||
# all clang-tidy checks except one that will never match. This one check is
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#include "cmsys/SystemTools.hxx"
|
||||
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#include <set>
|
||||
#include <stddef.h>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
|
||||
namespace {
|
||||
void on_directory_change(uv_fs_event_t* handle, const char* filename,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#pragma once
|
||||
|
||||
#include "cmConfigure.h" // IWYU pragma: keep
|
||||
#include "cmConfigure.h"
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
@@ -14,6 +14,8 @@ class cmRootWatcher;
|
||||
|
||||
class cmFileMonitor
|
||||
{
|
||||
CM_DISABLE_COPY(cmFileMonitor)
|
||||
|
||||
public:
|
||||
cmFileMonitor(uv_loop_t* l);
|
||||
~cmFileMonitor();
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#ifndef cmInstalledFile_h
|
||||
#define cmInstalledFile_h
|
||||
|
||||
#include "cmConfigure.h" // IWYU pragma: keep
|
||||
|
||||
#include "cmGeneratorExpression.h"
|
||||
#include "cm_auto_ptr.hxx"
|
||||
|
||||
|
||||
+7
-12
@@ -6,18 +6,15 @@
|
||||
#include "cmServerDictionary.h"
|
||||
#include "cmServerProtocol.h"
|
||||
#include "cmSystemTools.h"
|
||||
#include "cmVersionMacros.h"
|
||||
#include "cmake.h"
|
||||
|
||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||
#include "cm_jsoncpp_reader.h"
|
||||
#include "cm_jsoncpp_value.h"
|
||||
#endif
|
||||
#include "cm_jsoncpp_writer.h"
|
||||
#include "cmake.h"
|
||||
#include "cmsys/FStream.hxx"
|
||||
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <utility>
|
||||
|
||||
class cmServer::DebugInfo
|
||||
{
|
||||
@@ -270,10 +267,8 @@ void cmServer::WriteJsonObject(const Json::Value& jsonValue,
|
||||
}
|
||||
|
||||
if (!debug->OutputFile.empty()) {
|
||||
std::ofstream myfile;
|
||||
myfile.open(debug->OutputFile);
|
||||
cmsys::ofstream myfile(debug->OutputFile.c_str());
|
||||
myfile << result;
|
||||
myfile.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-4
@@ -2,13 +2,10 @@
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#pragma once
|
||||
|
||||
#include "cmListFileCache.h"
|
||||
#include "cmState.h"
|
||||
#include "cmConfigure.h"
|
||||
|
||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||
#include "cm_jsoncpp_value.h"
|
||||
#include "cm_uv.h"
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -21,6 +18,8 @@ class cmServerResponse;
|
||||
|
||||
class cmServer
|
||||
{
|
||||
CM_DISABLE_COPY(cmServer)
|
||||
|
||||
public:
|
||||
class DebugInfo;
|
||||
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#include "cmServerConnection.h"
|
||||
|
||||
#include "cmServerDictionary.h"
|
||||
|
||||
#include "cmFileMonitor.h"
|
||||
#include "cmServer.h"
|
||||
#include "cmServerDictionary.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -2,21 +2,19 @@
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#pragma once
|
||||
|
||||
#include "cmConfigure.h" // IWYU pragma: keep
|
||||
#include "cmConfigure.h"
|
||||
|
||||
#include "cm_uv.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||
#include "cm_uv.h"
|
||||
#endif
|
||||
|
||||
class cmServer;
|
||||
class cmFileMonitor;
|
||||
class LoopGuard;
|
||||
class cmServer;
|
||||
|
||||
class cmServerConnection
|
||||
{
|
||||
CM_DISABLE_COPY(cmServerConnection)
|
||||
|
||||
public:
|
||||
cmServerConnection();
|
||||
virtual ~cmServerConnection();
|
||||
|
||||
@@ -4,27 +4,32 @@
|
||||
|
||||
#include "cmExternalMakefileProjectGenerator.h"
|
||||
#include "cmFileMonitor.h"
|
||||
#include "cmGeneratorExpression.h"
|
||||
#include "cmGeneratorTarget.h"
|
||||
#include "cmGlobalGenerator.h"
|
||||
#include "cmLinkLineComputer.h"
|
||||
#include "cmListFileCache.h"
|
||||
#include "cmLocalGenerator.h"
|
||||
#include "cmMakefile.h"
|
||||
#include "cmServer.h"
|
||||
#include "cmServerDictionary.h"
|
||||
#include "cmSourceFile.h"
|
||||
#include "cmState.h"
|
||||
#include "cmStateDirectory.h"
|
||||
#include "cmStateSnapshot.h"
|
||||
#include "cmStateTypes.h"
|
||||
#include "cmSystemTools.h"
|
||||
#include "cm_uv.h"
|
||||
#include "cmake.h"
|
||||
|
||||
#include "cmServerDictionary.h"
|
||||
|
||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||
#include "cm_jsoncpp_reader.h"
|
||||
#include "cm_jsoncpp_value.h"
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
#include <functional>
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
// Get rid of some windows macros:
|
||||
|
||||
@@ -2,20 +2,17 @@
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#pragma once
|
||||
|
||||
#include "cmListFileCache.h"
|
||||
#include "cmake.h"
|
||||
#include "cmConfigure.h"
|
||||
|
||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||
#include "cm_jsoncpp_writer.h"
|
||||
#endif
|
||||
#include "cm_jsoncpp_value.h"
|
||||
#include "cmake.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
class cmake;
|
||||
class cmFileMonitor;
|
||||
class cmServer;
|
||||
|
||||
class cmServerRequest;
|
||||
|
||||
class cmServerResponse
|
||||
@@ -72,8 +69,11 @@ private:
|
||||
|
||||
class cmServerProtocol
|
||||
{
|
||||
CM_DISABLE_COPY(cmServerProtocol)
|
||||
|
||||
public:
|
||||
virtual ~cmServerProtocol() {}
|
||||
cmServerProtocol() = default;
|
||||
virtual ~cmServerProtocol() = default;
|
||||
|
||||
virtual std::pair<int, int> ProtocolVersion() const = 0;
|
||||
virtual bool IsExperimental() const = 0;
|
||||
|
||||
@@ -47,6 +47,12 @@
|
||||
#{ symbol: [ "std::pair", private, "<map>", public ] },
|
||||
#{ symbol: [ "std::pair", private, "<set>", public ] },
|
||||
|
||||
# IWYU wrongly suggests to include "cm_auto_ptr.hxx" in some places. This
|
||||
# might be a misinterpretation of a template specialization in <utility>.
|
||||
# As a workaround, map the symbol auto_ptr to "cmConfigure.h".
|
||||
# This will still correctly require "cm_auto_ptr.hxx" for CM_AUTO_PTR.
|
||||
{ symbol: [ "cm::auto_ptr", private, "\"cmConfigure.h\"", public ] },
|
||||
|
||||
# Wrappers for headers added in TR1 / C++11
|
||||
# { include: [ "<array>", public, "\"cm_array.hxx\"", public ] },
|
||||
# { include: [ "<functional>", public, "\"cm_functional.hxx\"", public ] },
|
||||
@@ -113,6 +119,11 @@
|
||||
{ include: [ "\"cmzlib/zconf.h\"", private, "\"cm_zlib.h\"", public ] },
|
||||
{ include: [ "\"cmzlib/zlib.h\"", private, "\"cm_zlib.h\"", public ] },
|
||||
|
||||
# System symbols used by libuv
|
||||
{ symbol: [ "SIGHUP", private, "\"cm_uv.h\"", public ] },
|
||||
{ symbol: [ "SIGINT", private, "\"cm_uv.h\"", public ] },
|
||||
{ symbol: [ "ssize_t", private, "\"cm_uv.h\"", public ] },
|
||||
|
||||
{ symbol: [ "std::ifstream", private, "\"cmsys/FStream.hxx\"", public ] },
|
||||
{ symbol: [ "std::ofstream", private, "\"cmsys/FStream.hxx\"", public ] },
|
||||
{ symbol: [ "cmsys::ifstream", private, "\"cmsys/FStream.hxx\"", public ] },
|
||||
|
||||
Reference in New Issue
Block a user