From aeff60e44c203dd67b316a6c6eab1454a408e1f7 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Wed, 23 Nov 2016 00:41:44 +0100 Subject: iwyu: Fix OSX specific issues --- Source/CPack/OSXScriptLauncher.cxx | 4 +++- Source/CPack/cmCPackBundleGenerator.cxx | 5 +++-- Source/CPack/cmCPackBundleGenerator.h | 4 ++++ Source/CPack/cmCPackDragNDropGenerator.cxx | 4 +++- Source/CPack/cmCPackDragNDropGenerator.h | 6 ++++++ Source/CPack/cmCPackOSXX11Generator.cxx | 11 ++++------- Source/CPack/cmCPackOSXX11Generator.h | 3 +++ Source/CPack/cmCPackPKGGenerator.cxx | 11 +++-------- Source/CPack/cmCPackPKGGenerator.h | 4 +++- Source/CPack/cmCPackPackageMakerGenerator.cxx | 18 +++++++++--------- Source/CPack/cmCPackPackageMakerGenerator.h | 3 +++ Source/CPack/cmCPackProductBuildGenerator.cxx | 11 ++++------- Source/CPack/cmCPackProductBuildGenerator.h | 4 ++++ Source/cmGlobalXCodeGenerator.cxx | 19 +++++++++++++++++-- Source/cmGlobalXCodeGenerator.h | 16 ++++++++++++++-- Source/cmLocalXCodeGenerator.cxx | 5 ++++- Source/cmLocalXCodeGenerator.h | 9 +++++++++ Source/cmMachO.cxx | 6 ++++-- Source/cmMachO.h | 5 +++++ Source/cmXCode21Object.cxx | 3 +++ Source/cmXCode21Object.h | 5 +++++ Source/cmXCodeObject.cxx | 5 +++-- Source/cmXCodeObject.h | 9 +++++++-- Source/cmakexbuild.cxx | 9 +++++++-- Tests/CMakeLib/run_compile_commands.cxx | 4 +++- 25 files changed, 133 insertions(+), 50 deletions(-) diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx index 6eb4a6c..b159e64 100644 --- a/Source/CPack/OSXScriptLauncher.cxx +++ b/Source/CPack/OSXScriptLauncher.cxx @@ -3,8 +3,10 @@ #include #include #include - #include +#include +#include +#include #include diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx index 61d0127..d538901 100644 --- a/Source/CPack/cmCPackBundleGenerator.cxx +++ b/Source/CPack/cmCPackBundleGenerator.cxx @@ -2,11 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackBundleGenerator.h" +#include +#include + #include "cmCPackLog.h" #include "cmSystemTools.h" -#include - cmCPackBundleGenerator::cmCPackBundleGenerator() { } diff --git a/Source/CPack/cmCPackBundleGenerator.h b/Source/CPack/cmCPackBundleGenerator.h index 9ea4304..c9200c1 100644 --- a/Source/CPack/cmCPackBundleGenerator.h +++ b/Source/CPack/cmCPackBundleGenerator.h @@ -3,7 +3,11 @@ #ifndef cmCPackBundleGenerator_h #define cmCPackBundleGenerator_h +#include +#include + #include "cmCPackDragNDropGenerator.h" +#include "cmCPackGenerator.h" /** \class cmCPackBundleGenerator * \brief A generator for OSX bundles diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index bdf4076..fd67df9 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -2,14 +2,16 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackDragNDropGenerator.h" +#include "cmCPackGenerator.h" #include "cmCPackLog.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" #include #include - #include +#include +#include #include diff --git a/Source/CPack/cmCPackDragNDropGenerator.h b/Source/CPack/cmCPackDragNDropGenerator.h index f803ad9..876eab7 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.h +++ b/Source/CPack/cmCPackDragNDropGenerator.h @@ -3,6 +3,12 @@ #ifndef cmCPackDragNDropGenerator_h #define cmCPackDragNDropGenerator_h +#include +#include +#include +#include +#include + #include "cmCPackGenerator.h" class cmGeneratedFileStream; diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index 225c1fb..0d8dc48 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -2,16 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackOSXX11Generator.h" +#include +#include + +#include "cmCPackGenerator.h" #include "cmCPackLog.h" #include "cmGeneratedFileStream.h" -#include "cmGlobalGenerator.h" -#include "cmMakefile.h" #include "cmSystemTools.h" -#include "cmake.h" - -#include -#include -#include cmCPackOSXX11Generator::cmCPackOSXX11Generator() { diff --git a/Source/CPack/cmCPackOSXX11Generator.h b/Source/CPack/cmCPackOSXX11Generator.h index eb1e5ff..1918e21 100644 --- a/Source/CPack/cmCPackOSXX11Generator.h +++ b/Source/CPack/cmCPackOSXX11Generator.h @@ -3,6 +3,9 @@ #ifndef cmCPackOSXX11Generator_h #define cmCPackOSXX11Generator_h +#include +#include + #include "cmCPackGenerator.h" /** \class cmCPackOSXX11Generator diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx index 785ee01..70ae267 100644 --- a/Source/CPack/cmCPackPKGGenerator.cxx +++ b/Source/CPack/cmCPackPKGGenerator.cxx @@ -2,18 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackPKGGenerator.h" +#include + #include "cmCPackComponentGroup.h" +#include "cmCPackGenerator.h" #include "cmCPackLog.h" -#include "cmGeneratedFileStream.h" -#include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" -#include "cmMakefile.h" #include "cmSystemTools.h" #include "cmXMLWriter.h" -#include "cmake.h" - -#include -#include cmCPackPKGGenerator::cmCPackPKGGenerator() { diff --git a/Source/CPack/cmCPackPKGGenerator.h b/Source/CPack/cmCPackPKGGenerator.h index bb3c1a7..1e96a62 100644 --- a/Source/CPack/cmCPackPKGGenerator.h +++ b/Source/CPack/cmCPackPKGGenerator.h @@ -5,10 +5,12 @@ #include #include +#include +#include +#include "cmCPackComponentGroup.h" #include "cmCPackGenerator.h" -class cmCPackComponent; class cmXMLWriter; /** \class cmCPackPKGGenerator diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index 25e8a1c..8000d6e 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -2,20 +2,20 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackPackageMakerGenerator.h" +#include +#include +#include +#include +#include +#include +#include +#include + #include "cmCPackComponentGroup.h" #include "cmCPackLog.h" #include "cmGeneratedFileStream.h" -#include "cmGlobalGenerator.h" -#include "cmMakefile.h" #include "cmSystemTools.h" #include "cmXMLWriter.h" -#include "cmake.h" - -#include -#include -#include - -#include static inline unsigned int getVersion(unsigned int major, unsigned int minor) { diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h index d679bc1..d4c6744 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.h +++ b/Source/CPack/cmCPackPackageMakerGenerator.h @@ -3,6 +3,9 @@ #ifndef cmCPackPackageMakerGenerator_h #define cmCPackPackageMakerGenerator_h +#include + +#include "cmCPackGenerator.h" #include "cmCPackPKGGenerator.h" class cmCPackComponent; diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx index ff0ec79..a46e3a6 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.cxx +++ b/Source/CPack/cmCPackProductBuildGenerator.cxx @@ -2,17 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackProductBuildGenerator.h" +#include +#include +#include + #include "cmCPackComponentGroup.h" #include "cmCPackLog.h" #include "cmGeneratedFileStream.h" -#include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" -#include "cmMakefile.h" #include "cmSystemTools.h" -#include "cmake.h" - -#include -#include cmCPackProductBuildGenerator::cmCPackProductBuildGenerator() { diff --git a/Source/CPack/cmCPackProductBuildGenerator.h b/Source/CPack/cmCPackProductBuildGenerator.h index 4145eb4..b6da470 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.h +++ b/Source/CPack/cmCPackProductBuildGenerator.h @@ -3,6 +3,10 @@ #ifndef cmCPackProductBuildGenerator_h #define cmCPackProductBuildGenerator_h +#include +#include + +#include "cmCPackGenerator.h" #include "cmCPackPKGGenerator.h" class cmCPackComponent; diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 84a8c5e..764f68e 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2,20 +2,35 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalXCodeGenerator.h" -#include "cmAlgorithms.h" +#include +#include +#include +#include +#include +#include + #include "cmComputeLinkInformation.h" #include "cmCustomCommandGenerator.h" +#include "cmDocumentationEntry.h" #include "cmGeneratedFileStream.h" +#include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalGeneratorFactory.h" +#include "cmLocalGenerator.h" #include "cmLocalXCodeGenerator.h" #include "cmMakefile.h" +#include "cmOutputConverter.h" #include "cmSourceFile.h" +#include "cmSourceGroup.h" +#include "cmStateTypes.h" +#include "cmSystemTools.h" +#include "cmTarget.h" #include "cmXCode21Object.h" #include "cmXCodeObject.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include +struct cmLinkImplementation; #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmXMLParser.h" diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index 98625d1..42c39aa 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -3,13 +3,25 @@ #ifndef cmGlobalXCodeGenerator_h #define cmGlobalXCodeGenerator_h -#include "cmGlobalGenerator.h" +#include +#include +#include +#include +#include +#include -#include "cmCustomCommand.h" +#include "cmGlobalGenerator.h" #include "cmXCodeObject.h" + +class cmCustomCommand; +class cmGeneratorTarget; class cmGlobalGeneratorFactory; +class cmLocalGenerator; +class cmMakefile; class cmSourceFile; class cmSourceGroup; +class cmake; +struct cmDocumentationEntry; /** \class cmGlobalXCodeGenerator * \brief Write a Unix makefiles. diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx index b596a8f..739ef43 100644 --- a/Source/cmLocalXCodeGenerator.cxx +++ b/Source/cmLocalXCodeGenerator.cxx @@ -4,9 +4,12 @@ #include "cmGeneratorTarget.h" #include "cmGlobalXCodeGenerator.h" -#include "cmMakefile.h" #include "cmSourceFile.h" +class cmGeneratorTarget; +class cmGlobalGenerator; +class cmMakefile; + cmLocalXCodeGenerator::cmLocalXCodeGenerator(cmGlobalGenerator* gg, cmMakefile* mf) : cmLocalGenerator(gg, mf) diff --git a/Source/cmLocalXCodeGenerator.h b/Source/cmLocalXCodeGenerator.h index 3756b61..b4a8c6c 100644 --- a/Source/cmLocalXCodeGenerator.h +++ b/Source/cmLocalXCodeGenerator.h @@ -3,8 +3,17 @@ #ifndef cmLocalXCodeGenerator_h #define cmLocalXCodeGenerator_h +#include // IWYU pragma: keep +#include +#include + #include "cmLocalGenerator.h" +class cmGeneratorTarget; +class cmGlobalGenerator; +class cmMakefile; +class cmSourceFile; + /** \class cmLocalXCodeGenerator * \brief Write a local Xcode project * diff --git a/Source/cmMachO.cxx b/Source/cmMachO.cxx index 95518f9..586e6c6 100644 --- a/Source/cmMachO.cxx +++ b/Source/cmMachO.cxx @@ -1,10 +1,12 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmStandardIncludes.h" // to get CMAKE_USE_MACH_PARSER first - #include "cmMachO.h" +#include #include +#include +#include +#include // Include the Mach-O format information system header. #include diff --git a/Source/cmMachO.h b/Source/cmMachO.h index a754c1f..901f17a 100644 --- a/Source/cmMachO.h +++ b/Source/cmMachO.h @@ -3,6 +3,11 @@ #ifndef cmMachO_h #define cmMachO_h +#include + +#include +#include + #if !defined(CMAKE_USE_MACH_PARSER) #error "This file may be included only if CMAKE_USE_MACH_PARSER is enabled." #endif diff --git a/Source/cmXCode21Object.cxx b/Source/cmXCode21Object.cxx index a783c70..719e627 100644 --- a/Source/cmXCode21Object.cxx +++ b/Source/cmXCode21Object.cxx @@ -2,6 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmXCode21Object.h" +#include +#include + #include "cmSystemTools.h" cmXCode21Object::cmXCode21Object(PBXType ptype, Type type) diff --git a/Source/cmXCode21Object.h b/Source/cmXCode21Object.h index 0db20e6..083d229 100644 --- a/Source/cmXCode21Object.h +++ b/Source/cmXCode21Object.h @@ -3,6 +3,11 @@ #ifndef cmXCode21Object_h #define cmXCode21Object_h +#include // IWYU pragma: keep + +#include +#include + #include "cmXCodeObject.h" class cmXCode21Object : public cmXCodeObject diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx index b1dc7ea..3689ac4 100644 --- a/Source/cmXCodeObject.cxx +++ b/Source/cmXCodeObject.cxx @@ -2,9 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmXCodeObject.h" -#include "cmSystemTools.h" +#include +#include -#include // CFUUIDCreate +#include "cmSystemTools.h" const char* cmXCodeObject::PBXTypeNames[] = { /* clang-format needs this comment to break after the opening brace */ diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h index d495130..3bfecdf 100644 --- a/Source/cmXCodeObject.h +++ b/Source/cmXCodeObject.h @@ -3,9 +3,14 @@ #ifndef cmXCodeObject_h #define cmXCodeObject_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include +#include +#include +#include +#include +#include class cmGeneratorTarget; diff --git a/Source/cmakexbuild.cxx b/Source/cmakexbuild.cxx index 82db012..e166bee 100644 --- a/Source/cmakexbuild.cxx +++ b/Source/cmakexbuild.cxx @@ -1,9 +1,14 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmStandardIncludes.h" -#include "cmSystemTools.h" +#include // IWYU pragma: keep + #include +#include +#include +#include + +#include "cmSystemTools.h" // This is a wrapper program for xcodebuild // it calls xcodebuild, and does two things diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx index 0bf0a7c..5d4ca70 100644 --- a/Tests/CMakeLib/run_compile_commands.cxx +++ b/Tests/CMakeLib/run_compile_commands.cxx @@ -1,4 +1,4 @@ -#include "cmSystemTools.h" +#include #include #include @@ -8,6 +8,8 @@ #include #include +#include "cmSystemTools.h" + class CompileCommandParser { public: -- cgit v0.12