Commit f69e768d authored by Daniel Pfeifer's avatar Daniel Pfeifer

Separate compilation for commands included in cmCommands

parent 1e555a44
Pipeline #32263 passed with stage
......@@ -401,9 +401,8 @@ set(SRCS
cm_codecvt.cxx
)
set(COMMAND_INCLUDES "#include \"cmTargetPropCommandBase.cxx\"\n")
list(APPEND SRCS cmTargetPropCommandBase.cxx)
set_property(SOURCE cmTargetPropCommandBase.cxx PROPERTY HEADER_FILE_ONLY ON)
set(COMMAND_INCLUDES "#include \"cmTargetPropCommandBase.h\"\n")
list(APPEND SRCS cmTargetPropCommandBase.cxx cmTargetPropCommandBase.h)
set(NEW_COMMANDS "")
foreach(command_file
cmAddCompileOptionsCommand
......@@ -418,6 +417,7 @@ foreach(command_file
cmInstallProgramsCommand
cmLinkLibrariesCommand
cmLoadCacheCommand
cmLoadCommandCommand
cmOutputRequiredFilesCommand
cmQTWrapCPPCommand
cmQTWrapUICommand
......@@ -435,15 +435,10 @@ foreach(command_file
cmVariableRequiresCommand
cmVariableWatchCommand
cmWriteFileCommand
# This one must be last because it includes windows.h and
# windows.h #defines GetCurrentDirectory which is a member
# of cmMakefile
cmLoadCommandCommand
)
set(COMMAND_INCLUDES "${COMMAND_INCLUDES}#include \"${command_file}.cxx\"\n")
set(COMMAND_INCLUDES "${COMMAND_INCLUDES}#include \"${command_file}.h\"\n")
set(NEW_COMMANDS "${NEW_COMMANDS}commands.push_back(new ${command_file});\n")
list(APPEND SRCS ${command_file}.cxx)
set_property(SOURCE ${command_file}.cxx PROPERTY HEADER_FILE_ONLY ON)
list(APPEND SRCS ${command_file}.cxx ${command_file}.h)
endforeach()
configure_file(cmCommands.cxx.in ${CMAKE_CURRENT_BINARY_DIR}/cmCommands.cxx @ONLY)
......
......@@ -2,6 +2,10 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmAddCompileOptionsCommand.h"
#include "cmMakefile.h"
class cmExecutionStatus;
bool cmAddCompileOptionsCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
{
......
......@@ -3,7 +3,14 @@
#ifndef cmAddCompileOptionsCommand_h
#define cmAddCompileOptionsCommand_h
#include <cmConfigure.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
class cmExecutionStatus;
class cmAddCompileOptionsCommand : public cmCommand
{
......
......@@ -2,9 +2,17 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmAuxSourceDirectoryCommand.h"
#include <algorithm>
#include <cmsys/Directory.hxx>
#include <stddef.h>
#include "cmAlgorithms.h"
#include "cmMakefile.h"
#include "cmSourceFile.h"
#include "cmSystemTools.h"
#include "cmake.h"
#include <cmsys/Directory.hxx>
class cmExecutionStatus;
// cmAuxSourceDirectoryCommand
bool cmAuxSourceDirectoryCommand::InitialPass(
......
......@@ -3,7 +3,14 @@
#ifndef cmAuxSourceDirectoryCommand_h
#define cmAuxSourceDirectoryCommand_h
#include <cmConfigure.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
class cmExecutionStatus;
/** \class cmAuxSourceDirectoryCommand
* \brief Specify auxiliary source code directories.
......
......@@ -2,8 +2,16 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmBuildNameCommand.h"
#include <algorithm>
#include <cmsys/RegularExpression.hxx>
#include "cmMakefile.h"
#include "cmPolicies.h"
#include "cmState.h"
#include "cmSystemTools.h"
class cmExecutionStatus;
// cmBuildNameCommand
bool cmBuildNameCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
......
......@@ -3,7 +3,14 @@
#ifndef cmBuildNameCommand_h
#define cmBuildNameCommand_h
#include <cmConfigure.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
class cmExecutionStatus;
class cmBuildNameCommand : public cmCommand
{
......
......@@ -2,6 +2,13 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCMakeHostSystemInformationCommand.h"
#include <sstream>
#include "cmMakefile.h"
#include "cmsys/SystemInformation.hxx"
class cmExecutionStatus;
// cmCMakeHostSystemInformation
bool cmCMakeHostSystemInformationCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
......
......@@ -3,9 +3,18 @@
#ifndef cmCMakeHostSystemInformationCommand_h
#define cmCMakeHostSystemInformationCommand_h
#include <cmConfigure.h>
#include <stddef.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
#include <cmsys/SystemInformation.hxx>
class cmExecutionStatus;
namespace cmsys {
class SystemInformation;
} // namespace cmsys
/** \class cmCMakeHostSystemInformationCommand
* \brief Query host system specific information
......
......@@ -7,10 +7,12 @@
#include "cmCPluginAPI.h"
#include "cmExecutionStatus.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmVersion.h"
#include "cmSourceFile.h"
#include "cmState.h"
#include "cmVersion.h"
#include <stdlib.h>
......
......@@ -2,6 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmElseIfCommand.h"
class cmExecutionStatus;
bool cmElseIfCommand::InitialPass(std::vector<std::string> const&,
cmExecutionStatus&)
{
......
......@@ -3,7 +3,14 @@
#ifndef cmElseIfCommand_h
#define cmElseIfCommand_h
#include "cmIfCommand.h"
#include <cmConfigure.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
class cmExecutionStatus;
/** \class cmElseIfCommand
* \brief ends an if block
......
......@@ -2,15 +2,22 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmExportCommand.h"
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmake.h"
#include <cmsys/Encoding.hxx>
#include <cmsys/RegularExpression.hxx>
#include <map>
#include <sstream>
#include "cmExportBuildAndroidMKGenerator.h"
#include "cmExportBuildFileGenerator.h"
#include "cmExportSetMap.h"
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmState.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmake.h"
class cmExecutionStatus;
#if defined(__HAIKU__)
#include <FindDirectory.h>
......@@ -271,6 +278,7 @@ bool cmExportCommand::HandlePackage(std::vector<std::string> const& args)
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <windows.h>
#undef GetCurrentDirectory
void cmExportCommand::ReportRegistryError(std::string const& msg,
std::string const& key, long err)
......
......@@ -3,9 +3,15 @@
#ifndef cmExportCommand_h
#define cmExportCommand_h
#include <cmConfigure.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmCommandArgumentsHelper.h"
#include "cmTypeMacro.h"
class cmExportBuildFileGenerator;
class cmExecutionStatus;
class cmExportSet;
/** \class cmExportLibraryDependenciesCommand
......
......@@ -2,12 +2,20 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmExportLibraryDependenciesCommand.h"
#include <cm_auto_ptr.hxx>
#include <cmsys/FStream.hxx>
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmVersion.h"
#include "cmMakefile.h"
#include "cmPolicies.h"
#include "cmState.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmTargetLinkLibraryType.h"
#include "cmake.h"
#include <cm_auto_ptr.hxx>
class cmExecutionStatus;
bool cmExportLibraryDependenciesCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
......
......@@ -3,7 +3,14 @@
#ifndef cmExportLibraryDependenciesCommand_h
#define cmExportLibraryDependenciesCommand_h
#include <cmConfigure.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
class cmExecutionStatus;
class cmExportLibraryDependenciesCommand : public cmCommand
{
......
......@@ -2,7 +2,15 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmFLTKWrapUICommand.h"
#include <stddef.h>
#include "cmCustomCommandLines.h"
#include "cmMakefile.h"
#include "cmSourceFile.h"
#include "cmSystemTools.h"
class cmExecutionStatus;
class cmTarget;
// cmFLTKWrapUICommand
bool cmFLTKWrapUICommand::InitialPass(std::vector<std::string> const& args,
......
......@@ -3,7 +3,15 @@
#ifndef cmFLTKWrapUICommand_h
#define cmFLTKWrapUICommand_h
#include <cmConfigure.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
class cmExecutionStatus;
class cmSourceFile;
/** \class cmFLTKWrapUICommand
* \brief Create .h and .cxx files rules for FLTK user interfaces files
......
......@@ -2,6 +2,12 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmIncludeExternalMSProjectCommand.h"
#ifdef _WIN32
#include "cmSystemTools.h"
#endif
class cmExecutionStatus;
// cmIncludeExternalMSProjectCommand
bool cmIncludeExternalMSProjectCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
......
......@@ -3,7 +3,14 @@
#ifndef cmIncludeExternalMSProjectCommand_h
#define cmIncludeExternalMSProjectCommand_h
#include <cmConfigure.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
class cmExecutionStatus;
/** \class cmIncludeExternalMSProjectCommand
* \brief Specify an external MS project file for inclusion in the workspace.
......
......@@ -2,7 +2,15 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmInstallProgramsCommand.h"
#include "cmGeneratorExpression.h"
#include "cmGlobalGenerator.h"
#include "cmInstallFilesGenerator.h"
#include "cmInstallGenerator.h"
#include "cmMakefile.h"
#include "cmSystemTools.h"
class cmExecutionStatus;
// cmExecutableCommand
bool cmInstallProgramsCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
......
......@@ -3,7 +3,14 @@
#ifndef cmInstallProgramsCommand_h
#define cmInstallProgramsCommand_h
#include <cmConfigure.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
class cmExecutionStatus;
/** \class cmInstallProgramsCommand
* \brief Specifies where to install some programs
......
......@@ -2,6 +2,10 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmLinkLibrariesCommand.h"
#include "cmMakefile.h"
class cmExecutionStatus;
// cmLinkLibrariesCommand
bool cmLinkLibrariesCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
......
......@@ -3,7 +3,14 @@
#ifndef cmLinkLibrariesCommand_h
#define cmLinkLibrariesCommand_h
#include <cmConfigure.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
class cmExecutionStatus;
/** \class cmLinkLibrariesCommand
* \brief Specify a list of libraries to link into executables.
......
......@@ -3,7 +3,13 @@
#include "cmLoadCacheCommand.h"
#include <cmsys/FStream.hxx>
#include <cmsys/RegularExpression.hxx>
#include "cmMakefile.h"
#include "cmState.h"
#include "cmSystemTools.h"
#include "cmake.h"
class cmExecutionStatus;
// cmLoadCacheCommand
bool cmLoadCacheCommand::InitialPass(std::vector<std::string> const& args,
......
......@@ -3,7 +3,15 @@
#ifndef cmLoadCacheCommand_h
#define cmLoadCacheCommand_h
#include <cmConfigure.h>
#include <set>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
class cmExecutionStatus;
/** \class cmLoadCacheCommand
* \brief load a cache file
......
......@@ -5,16 +5,23 @@
#include "cmCPluginAPI.cxx"
#include "cmCPluginAPI.h"
#include "cmDynamicLoader.h"
#include "cmMakefile.h"
#include "cmPolicies.h"
#include "cmState.h"
#include "cmSystemTools.h"
#include <cmsys/DynamicLoader.hxx>
class cmExecutionStatus;
#include <signal.h>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef __QNX__
#include <malloc.h> /* for malloc/free on QNX */
#endif
#include <signal.h>
extern "C" void TrapsForSignalsCFunction(int sig);
// a class for loadabple commands
......
......@@ -3,7 +3,14 @@
#ifndef cmLoadCommandCommand_h
#define cmLoadCommandCommand_h
#include <cmConfigure.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
class cmExecutionStatus;
class cmLoadCommandCommand : public cmCommand
{
......
......@@ -2,8 +2,18 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmOutputRequiredFilesCommand.h"
#include "cmAlgorithms.h"
#include <cmsys/FStream.hxx>
#include <cmsys/RegularExpression.hxx>
#include "cmAlgorithms.h"
#include "cmGeneratorExpression.h"
#include "cmMakefile.h"
#include "cmPolicies.h"
#include "cmSourceFile.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
class cmExecutionStatus;
/** \class cmDependInformation
* \brief Store dependency information for a single source file.
......
......@@ -3,9 +3,17 @@
#ifndef cmOutputRequiredFilesCommand_h
#define cmOutputRequiredFilesCommand_h
#include <cmConfigure.h>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
class cmDependInformation;
class cmExecutionStatus;
class cmOutputRequiredFilesCommand : public cmCommand
{
......
......@@ -2,6 +2,13 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmQTWrapCPPCommand.h"
#include "cmCustomCommandLines.h"
#include "cmMakefile.h"
#include "cmSourceFile.h"
#include "cmSystemTools.h"
class cmExecutionStatus;
// cmQTWrapCPPCommand
bool cmQTWrapCPPCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
......
......@@ -3,9 +3,14 @@
#ifndef cmQTWrapCPPCommand_h
#define cmQTWrapCPPCommand_h
#include <cmConfigure.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
#include "cmSourceFile.h"
class cmExecutionStatus;
/** \class cmQTWrapCPPCommand
* \brief Create moc file rules for Qt classes
......
......@@ -2,6 +2,13 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmQTWrapUICommand.h"
#include "cmCustomCommandLines.h"
#include "cmMakefile.h"
#include "cmSourceFile.h"
#include "cmSystemTools.h"
class cmExecutionStatus;
// cmQTWrapUICommand
bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
......
......@@ -3,9 +3,14 @@
#ifndef cmQTWrapUICommand_h
#define cmQTWrapUICommand_h
#include <cmConfigure.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
#include "cmSourceFile.h"
class cmExecutionStatus;
/** \class cmQTWrapUICommand
* \brief Create .h and .cxx files rules for Qt user interfaces files
......
......@@ -2,6 +2,11 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmRemoveCommand.h"
#include "cmMakefile.h"
#include "cmSystemTools.h"
class cmExecutionStatus;
// cmRemoveCommand
bool cmRemoveCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
......
......@@ -3,7 +3,14 @@
#ifndef cmRemoveCommand_h
#define cmRemoveCommand_h
#include <cmConfigure.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
class cmExecutionStatus;
/** \class cmRemoveCommand
* \brief remove command
......
......@@ -2,6 +2,10 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmRemoveDefinitionsCommand.h"
#include "cmMakefile.h"
class cmExecutionStatus;
// cmRemoveDefinitionsCommand
bool cmRemoveDefinitionsCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
......
......@@ -3,7 +3,14 @@
#ifndef cmRemoveDefinitionsCommand_h
#define cmRemoveDefinitionsCommand_h
#include <cmConfigure.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
class cmExecutionStatus;
/** \class cmRemoveDefinitionsCommand
* \brief Specify a list of compiler defines
......
......@@ -2,6 +2,14 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmSourceGroupCommand.h"
#include <sstream>
#include "cmMakefile.h"
#include "cmSourceGroup.h"
#include "cmSystemTools.h"
class cmExecutionStatus;
// cmSourceGroupCommand
bool cmSourceGroupCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
......
......@@ -3,7 +3,14 @@
#ifndef cmSourceGroupCommand_h
#define cmSourceGroupCommand_h
#include <cmConfigure.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
class cmExecutionStatus;
/** \class cmSourceGroupCommand
* \brief Adds a cmSourceGroup to the cmMakefile.
......
......@@ -2,6 +2,10 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmSubdirDependsCommand.h"
#include "cmPolicies.h"
class cmExecutionStatus;
bool cmSubdirDependsCommand::InitialPass(std::vector<std::string> const&,
cmExecutionStatus&)
{
......
......@@ -3,7 +3,14 @@
#ifndef cmSubdirDependsCommand_h
#define cmSubdirDependsCommand_h
#include <cmConfigure.h>
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmTypeMacro.h"
class cmExecutionStatus;
class cmSubdirDependsCommand : public cmCommand
{
......
......@@ -2,7 +2,14 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmTargetCompileDefinitionsCommand.h"
#include <sstream>
#include "cmAlgorithms.h"
#include "cmMakefile.h"
#include "cmTarget.h"
#include "cmake.h"
class cmExecutionStatus;
bool cmTargetCompileDefinitionsCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
......
......@@ -3,7 +3,16 @@
#ifndef cmTargetCompileDefinitionsCommand_h
#define cmTargetCompileDefinitionsCommand_h
#include <cmConfigure.h>
#include <string>
#include <vector>