Merge topic 'include-what-you-use'

a2af850b fix a batch of include-what-you-use violations
This commit is contained in:
Brad King 2016-08-17 10:46:32 -04:00 committed by CMake Topic Stage
commit 29593b79a2
27 changed files with 108 additions and 42 deletions

View File

@ -14,6 +14,8 @@
#include "cmCursesLabelWidget.h" #include "cmCursesLabelWidget.h"
class cmake;
class cmCursesCacheEntryComposite class cmCursesCacheEntryComposite
{ {
public: public:

View File

@ -17,6 +17,7 @@
#include "cmPropertyMap.h" #include "cmPropertyMap.h"
#include "cmState.h" #include "cmState.h"
class cmake;
class cmMarkAsAdvancedCommand; class cmMarkAsAdvancedCommand;
/** \class cmCacheManager /** \class cmCacheManager

View File

@ -16,13 +16,13 @@
#include "cmTarget.h" #include "cmTarget.h"
class cmCustomCommand;
class cmGeneratedFileStream; class cmGeneratedFileStream;
class cmGeneratorTarget;
class cmGlobalGhsMultiGenerator; class cmGlobalGhsMultiGenerator;
class cmLocalGhsMultiGenerator; class cmLocalGhsMultiGenerator;
class cmMakefile; class cmMakefile;
class cmSourceFile; class cmSourceFile;
class cmGeneratedFileStream;
class cmCustomCommand;
class cmGhsMultiTargetGenerator class cmGhsMultiTargetGenerator
{ {

View File

@ -15,10 +15,19 @@
#include "cmCacheManager.h" #include "cmCacheManager.h"
#include "cmCommand.h" #include "cmCommand.h"
#include "cmDefinitions.h" #include "cmDefinitions.h"
#include "cmListFileCache.h"
#include "cmSystemTools.h"
#include "cmTypeMacro.h"
#include "cmVersion.h" #include "cmVersion.h"
#include "cmake.h" #include "cmake.h"
#include <algorithm>
#include <assert.h> #include <assert.h>
#include <cmsys/RegularExpression.hxx>
#include <iterator>
#include <stdio.h>
#include <string.h>
#include <utility>
struct cmState::SnapshotDataType struct cmState::SnapshotDataType
{ {

View File

@ -12,19 +12,25 @@
#ifndef cmState_h #ifndef cmState_h
#define cmState_h #define cmState_h
#include "cmStandardIncludes.h" #include <cmConfigure.h> // IWYU pragma: keep
#include "cmAlgorithms.h" #include "cmAlgorithms.h"
#include "cmDefinitions.h"
#include "cmLinkedTree.h" #include "cmLinkedTree.h"
#include "cmPolicies.h" #include "cmPolicies.h"
#include "cmProperty.h"
#include "cmPropertyDefinitionMap.h" #include "cmPropertyDefinitionMap.h"
#include "cmPropertyMap.h" #include "cmPropertyMap.h"
class cmake; #include <map>
class cmCommand; #include <set>
class cmDefinitions; #include <string>
class cmListFileBacktrace; #include <vector>
class cmCacheManager; class cmCacheManager;
class cmCommand;
class cmListFileBacktrace;
class cmPropertyDefinition;
class cmState class cmState
{ {

View File

@ -12,10 +12,13 @@
#ifndef cmSystemTools_h #ifndef cmSystemTools_h
#define cmSystemTools_h #define cmSystemTools_h
#include "cmStandardIncludes.h" #include <cmConfigure.h> // IWYU pragma: keep
#include <cmsys/Process.h> #include <cmsys/Process.h>
#include <cmsys/SystemTools.hxx> #include <cmsys/SystemTools.hxx>
#include <stddef.h>
#include <string>
#include <vector>
class cmSystemToolsFileTime; class cmSystemToolsFileTime;

View File

@ -12,21 +12,25 @@
#include "cmTarget.h" #include "cmTarget.h"
#include "cmAlgorithms.h" #include "cmAlgorithms.h"
#include "cmComputeLinkInformation.h"
#include "cmGeneratorExpression.h" #include "cmGeneratorExpression.h"
#include "cmGeneratorExpressionDAGChecker.h" #include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h" #include "cmGlobalGenerator.h"
#include "cmListFileCache.h" #include "cmListFileCache.h"
#include "cmMakefile.h" #include "cmMakefile.h"
#include "cmOutputConverter.h" #include "cmOutputConverter.h"
#include "cmProperty.h"
#include "cmSourceFile.h" #include "cmSourceFile.h"
#include "cmSourceFileLocation.h"
#include "cmSystemTools.h"
#include "cmake.h" #include "cmake.h"
#include <algorithm>
#include <assert.h> #include <assert.h>
#include <cmsys/RegularExpression.hxx> #include <cmsys/RegularExpression.hxx>
#include <errno.h>
#include <map> #include <map>
#include <set> #include <set>
#include <stdlib.h> // required for atof #include <sstream>
#include <string.h>
#if defined(CMake_HAVE_CXX_UNORDERED_SET) #if defined(CMake_HAVE_CXX_UNORDERED_SET)
#include <unordered_set> #include <unordered_set>

View File

@ -12,14 +12,23 @@
#ifndef cmTarget_h #ifndef cmTarget_h
#define cmTarget_h #define cmTarget_h
#include "cmStandardIncludes.h" #include <cmConfigure.h> // IWYU pragma: keep
#include "cmAlgorithms.h"
#include "cmCustomCommand.h" #include "cmCustomCommand.h"
#include "cmListFileCache.h" #include "cmListFileCache.h"
#include "cmPolicies.h" #include "cmPolicies.h"
#include "cmPropertyMap.h" #include "cmPropertyMap.h"
#include "cmState.h"
#include "cmTargetLinkLibraryType.h"
#include <iosfwd>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <vector>
#include <cm_auto_ptr.hxx>
#if defined(CMAKE_BUILD_WITH_CMAKE) #if defined(CMAKE_BUILD_WITH_CMAKE)
#ifdef CMake_HAVE_CXX_UNORDERED_MAP #ifdef CMake_HAVE_CXX_UNORDERED_MAP
#include <unordered_map> #include <unordered_map>
@ -28,16 +37,10 @@
#endif #endif
#endif #endif
class cmake;
class cmMakefile; class cmMakefile;
class cmSourceFile; class cmSourceFile;
class cmGlobalGenerator;
class cmListFileBacktrace;
class cmTarget;
class cmGeneratorTarget;
class cmTargetTraceDependencies;
class cmTargetInternals; class cmTargetInternals;
class cmTargetInternalPointer class cmTargetInternalPointer
{ {
public: public:

View File

@ -11,10 +11,10 @@
============================================================================*/ ============================================================================*/
#include "cmTest.h" #include "cmTest.h"
#include "cmSystemTools.h"
#include "cmMakefile.h" #include "cmMakefile.h"
#include "cmake.h" #include "cmProperty.h"
#include "cmState.h"
#include "cmSystemTools.h"
cmTest::cmTest(cmMakefile* mf) cmTest::cmTest(cmMakefile* mf)
: Backtrace(mf->GetBacktrace()) : Backtrace(mf->GetBacktrace())

View File

@ -12,11 +12,14 @@
#ifndef cmTest_h #ifndef cmTest_h
#define cmTest_h #define cmTest_h
#include "cmStandardIncludes.h" #include <cmConfigure.h> // IWYU pragma: keep
#include "cmCustomCommand.h"
#include "cmListFileCache.h" #include "cmListFileCache.h"
#include "cmPropertyMap.h" #include "cmPropertyMap.h"
#include <string>
#include <vector>
class cmMakefile; class cmMakefile;
/** \class cmTest /** \class cmTest

View File

@ -12,11 +12,19 @@
#include "cmTestGenerator.h" #include "cmTestGenerator.h"
#include "cmGeneratorExpression.h" #include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
#include "cmLocalGenerator.h" #include "cmLocalGenerator.h"
#include "cmOutputConverter.h" #include "cmOutputConverter.h"
#include "cmProperty.h"
#include "cmPropertyMap.h"
#include "cmState.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmTest.h" #include "cmTest.h"
#include <map>
#include <ostream>
#include <utility>
cmTestGenerator::cmTestGenerator( cmTestGenerator::cmTestGenerator(
cmTest* test, std::vector<std::string> const& configurations) cmTest* test, std::vector<std::string> const& configurations)
: cmScriptGenerator("CTEST_CONFIGURATION_TYPE", configurations) : cmScriptGenerator("CTEST_CONFIGURATION_TYPE", configurations)

View File

@ -12,10 +12,16 @@
#ifndef cmTestGenerator_h #ifndef cmTestGenerator_h
#define cmTestGenerator_h #define cmTestGenerator_h
#include <cmConfigure.h> // IWYU pragma: keep
#include "cmScriptGenerator.h" #include "cmScriptGenerator.h"
class cmTest; #include <iosfwd>
#include <string>
#include <vector>
class cmLocalGenerator; class cmLocalGenerator;
class cmTest;
/** \class cmTestGenerator /** \class cmTestGenerator
* \brief Support class for generating install scripts. * \brief Support class for generating install scripts.

View File

@ -11,10 +11,10 @@
============================================================================*/ ============================================================================*/
#include "cmUuid.h" #include "cmUuid.h"
#include <string.h>
#include "cm_sha2.h" #include "cm_sha2.h"
#include <cmsys/MD5.h> #include <cmsys/MD5.h>
#include <string.h>
cmUuid::cmUuid() cmUuid::cmUuid()
{ {

View File

@ -12,7 +12,10 @@
#ifndef cmUuid_h #ifndef cmUuid_h
#define cmUuid_h #define cmUuid_h
#include "cmStandardIncludes.h" #include <cmConfigure.h> // IWYU pragma: keep
#include <string>
#include <vector>
/** \class cmUuid /** \class cmUuid
* \brief Utility class to generate UUIDs as defined by RFC4122 * \brief Utility class to generate UUIDs as defined by RFC4122

View File

@ -13,7 +13,9 @@
#include "cmAlgorithms.h" #include "cmAlgorithms.h"
#include <algorithm>
#include <cm_auto_ptr.hxx> #include <cm_auto_ptr.hxx>
#include <utility>
static const char* const cmVariableWatchAccessStrings[] = { static const char* const cmVariableWatchAccessStrings[] = {
"READ_ACCESS", "UNKNOWN_READ_ACCESS", "UNKNOWN_DEFINED_ACCESS", "READ_ACCESS", "UNKNOWN_READ_ACCESS", "UNKNOWN_DEFINED_ACCESS",

View File

@ -12,7 +12,11 @@
#ifndef cmVariableWatch_h #ifndef cmVariableWatch_h
#define cmVariableWatch_h #define cmVariableWatch_h
#include "cmStandardIncludes.h" #include <cmConfigure.h> // IWYU pragma: keep
#include <map>
#include <string>
#include <vector>
class cmMakefile; class cmMakefile;

View File

@ -11,7 +11,7 @@
============================================================================*/ ============================================================================*/
#include "cmVersion.h" #include "cmVersion.h"
#include "cmVersionMacros.h" #include "cmVersionConfig.h"
unsigned int cmVersion::GetMajorVersion() unsigned int cmVersion::GetMajorVersion()
{ {

View File

@ -12,7 +12,7 @@
#ifndef cmVersion_h #ifndef cmVersion_h
#define cmVersion_h #define cmVersion_h
#include "cmStandardIncludes.h" #include <cm_kwiml.h>
/** \class cmVersion /** \class cmVersion
* \brief Helper class for providing CMake and CTest version information. * \brief Helper class for providing CMake and CTest version information.

View File

@ -11,10 +11,12 @@
============================================================================*/ ============================================================================*/
#include "cmXMLParser.h" #include "cmXMLParser.h"
#include <cmsys/FStream.hxx>
#include <cm_expat.h> #include <cm_expat.h>
#include <cmsys/FStream.hxx>
#include <ctype.h> #include <ctype.h>
#include <iostream>
#include <sstream>
#include <string.h>
cmXMLParser::cmXMLParser() cmXMLParser::cmXMLParser()
{ {

View File

@ -12,7 +12,9 @@
#ifndef cmXMLParser_h #ifndef cmXMLParser_h
#define cmXMLParser_h #define cmXMLParser_h
#include "cmStandardIncludes.h" #include <cmConfigure.h> // IWYU pragma: keep
#include <string>
extern "C" { extern "C" {
void cmXMLParserStartElement(void*, const char*, const char**); void cmXMLParserStartElement(void*, const char*, const char**);

View File

@ -13,9 +13,7 @@
#include "cm_utf8.h" #include "cm_utf8.h"
#include <iostream>
#include <sstream> #include <sstream>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

View File

@ -12,7 +12,7 @@
#ifndef cmXMLSafe_h #ifndef cmXMLSafe_h
#define cmXMLSafe_h #define cmXMLSafe_h
#include <cmsys/Configure.hxx> #include <cmConfigure.h> // IWYU pragma: keep
#include <iosfwd> #include <iosfwd>
#include <string> #include <string>

View File

@ -11,8 +11,6 @@
============================================================================*/ ============================================================================*/
#include "cmXMLWriter.h" #include "cmXMLWriter.h"
#include "cmXMLSafe.h"
#include <cassert> #include <cassert>
#include <cmsys/FStream.hxx> #include <cmsys/FStream.hxx>

View File

@ -12,7 +12,7 @@
#ifndef cmXMLWiter_h #ifndef cmXMLWiter_h
#define cmXMLWiter_h #define cmXMLWiter_h
#include "cmStandardIncludes.h" #include <cmConfigure.h> // IWYU pragma: keep
#include "cmXMLSafe.h" #include "cmXMLSafe.h"

View File

@ -21,6 +21,7 @@
#include <cmSystemTools.h> #include <cmSystemTools.h>
#include <cmsys/Encoding.hxx> #include <cmsys/Encoding.hxx>
#include <algorithm>
#include <sstream> #include <sstream>
#include <windows.h> #include <windows.h>

View File

@ -1,5 +1,13 @@
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include <fstream>
#include <iostream>
#include <map>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
class CompileCommandParser class CompileCommandParser
{ {
public: public:

View File

@ -11,6 +11,9 @@
============================================================================*/ ============================================================================*/
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include <iostream>
#include <string>
#define cmPassed(m) std::cout << "Passed: " << m << "\n" #define cmPassed(m) std::cout << "Passed: " << m << "\n"
#define cmFailed(m) \ #define cmFailed(m) \
std::cout << "FAILED: " << m << "\n"; \ std::cout << "FAILED: " << m << "\n"; \