Add common base classes to Makefile and Ninja generators
Provide a place to move functionality common to both.
This commit is contained in:
parent
6f6664f578
commit
001f9b3617
|
@ -165,6 +165,8 @@ set(SRCS
|
||||||
cmCommandArgumentLexer.cxx
|
cmCommandArgumentLexer.cxx
|
||||||
cmCommandArgumentParser.cxx
|
cmCommandArgumentParser.cxx
|
||||||
cmCommandArgumentParserHelper.cxx
|
cmCommandArgumentParserHelper.cxx
|
||||||
|
cmCommonTargetGenerator.cxx
|
||||||
|
cmCommonTargetGenerator.h
|
||||||
cmComputeComponentGraph.cxx
|
cmComputeComponentGraph.cxx
|
||||||
cmComputeComponentGraph.h
|
cmComputeComponentGraph.h
|
||||||
cmComputeLinkDepends.cxx
|
cmComputeLinkDepends.cxx
|
||||||
|
@ -260,6 +262,8 @@ set(SRCS
|
||||||
cmGeneratorExpression.h
|
cmGeneratorExpression.h
|
||||||
cmGeneratorTarget.cxx
|
cmGeneratorTarget.cxx
|
||||||
cmGeneratorTarget.h
|
cmGeneratorTarget.h
|
||||||
|
cmGlobalCommonGenerator.cxx
|
||||||
|
cmGlobalCommonGenerator.h
|
||||||
cmGlobalGenerator.cxx
|
cmGlobalGenerator.cxx
|
||||||
cmGlobalGenerator.h
|
cmGlobalGenerator.h
|
||||||
cmGlobalGeneratorFactory.h
|
cmGlobalGeneratorFactory.h
|
||||||
|
@ -285,6 +289,8 @@ set(SRCS
|
||||||
cmListFileCache.cxx
|
cmListFileCache.cxx
|
||||||
cmListFileCache.h
|
cmListFileCache.h
|
||||||
cmListFileLexer.c
|
cmListFileLexer.c
|
||||||
|
cmLocalCommonGenerator.cxx
|
||||||
|
cmLocalCommonGenerator.h
|
||||||
cmLocalGenerator.cxx
|
cmLocalGenerator.cxx
|
||||||
cmLocalGenerator.h
|
cmLocalGenerator.h
|
||||||
cmLocalUnixMakefileGenerator3.cxx
|
cmLocalUnixMakefileGenerator3.cxx
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
/*============================================================================
|
||||||
|
CMake - Cross Platform Makefile Generator
|
||||||
|
Copyright 2000-2015 Kitware, Inc., Insight Software Consortium
|
||||||
|
|
||||||
|
Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
see accompanying file Copyright.txt for details.
|
||||||
|
|
||||||
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
See the License for more information.
|
||||||
|
============================================================================*/
|
||||||
|
#include "cmCommonTargetGenerator.h"
|
||||||
|
|
||||||
|
cmCommonTargetGenerator::cmCommonTargetGenerator()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
cmCommonTargetGenerator::~cmCommonTargetGenerator()
|
||||||
|
{
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
/*============================================================================
|
||||||
|
CMake - Cross Platform Makefile Generator
|
||||||
|
Copyright 2000-2015 Kitware, Inc., Insight Software Consortium
|
||||||
|
|
||||||
|
Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
see accompanying file Copyright.txt for details.
|
||||||
|
|
||||||
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
See the License for more information.
|
||||||
|
============================================================================*/
|
||||||
|
#ifndef cmCommonTargetGenerator_h
|
||||||
|
#define cmCommonTargetGenerator_h
|
||||||
|
|
||||||
|
#include "cmStandardIncludes.h"
|
||||||
|
|
||||||
|
/** \class cmCommonTargetGenerator
|
||||||
|
* \brief Common infrastructure for Makefile and Ninja per-target generators
|
||||||
|
*/
|
||||||
|
class cmCommonTargetGenerator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
cmCommonTargetGenerator();
|
||||||
|
virtual ~cmCommonTargetGenerator();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,21 @@
|
||||||
|
/*============================================================================
|
||||||
|
CMake - Cross Platform Makefile Generator
|
||||||
|
Copyright 2000-2015 Kitware, Inc., Insight Software Consortium
|
||||||
|
|
||||||
|
Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
see accompanying file Copyright.txt for details.
|
||||||
|
|
||||||
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
See the License for more information.
|
||||||
|
============================================================================*/
|
||||||
|
#include "cmGlobalCommonGenerator.h"
|
||||||
|
|
||||||
|
cmGlobalCommonGenerator::cmGlobalCommonGenerator(cmake* cm):
|
||||||
|
cmGlobalGenerator(cm)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
cmGlobalCommonGenerator::~cmGlobalCommonGenerator()
|
||||||
|
{
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
/*============================================================================
|
||||||
|
CMake - Cross Platform Makefile Generator
|
||||||
|
Copyright 2000-2015 Kitware, Inc., Insight Software Consortium
|
||||||
|
|
||||||
|
Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
see accompanying file Copyright.txt for details.
|
||||||
|
|
||||||
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
See the License for more information.
|
||||||
|
============================================================================*/
|
||||||
|
#ifndef cmGlobalCommonGenerator_h
|
||||||
|
#define cmGlobalCommonGenerator_h
|
||||||
|
|
||||||
|
#include "cmGlobalGenerator.h"
|
||||||
|
|
||||||
|
/** \class cmGlobalCommonGenerator
|
||||||
|
* \brief Common infrastructure for Makefile and Ninja global generators.
|
||||||
|
*/
|
||||||
|
class cmGlobalCommonGenerator : public cmGlobalGenerator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
cmGlobalCommonGenerator(cmake* cm);
|
||||||
|
~cmGlobalCommonGenerator();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -505,7 +505,7 @@ void cmGlobalNinjaGenerator::WriteDefault(std::ostream& os,
|
||||||
|
|
||||||
|
|
||||||
cmGlobalNinjaGenerator::cmGlobalNinjaGenerator(cmake* cm)
|
cmGlobalNinjaGenerator::cmGlobalNinjaGenerator(cmake* cm)
|
||||||
: cmGlobalGenerator(cm)
|
: cmGlobalCommonGenerator(cm)
|
||||||
, BuildFileStream(0)
|
, BuildFileStream(0)
|
||||||
, RulesFileStream(0)
|
, RulesFileStream(0)
|
||||||
, CompileCommandsStream(0)
|
, CompileCommandsStream(0)
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#ifndef cmGlobalNinjaGenerator_h
|
#ifndef cmGlobalNinjaGenerator_h
|
||||||
# define cmGlobalNinjaGenerator_h
|
# define cmGlobalNinjaGenerator_h
|
||||||
|
|
||||||
# include "cmGlobalGenerator.h"
|
# include "cmGlobalCommonGenerator.h"
|
||||||
# include "cmGlobalGeneratorFactory.h"
|
# include "cmGlobalGeneratorFactory.h"
|
||||||
# include "cmNinjaTypes.h"
|
# include "cmNinjaTypes.h"
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class cmGeneratorTarget;
|
||||||
* - We extensively use Ninja variable overloading system to minimize the
|
* - We extensively use Ninja variable overloading system to minimize the
|
||||||
* number of generated rules.
|
* number of generated rules.
|
||||||
*/
|
*/
|
||||||
class cmGlobalNinjaGenerator : public cmGlobalGenerator
|
class cmGlobalNinjaGenerator : public cmGlobalCommonGenerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// The default name of Ninja's build file. Typically: build.ninja.
|
/// The default name of Ninja's build file. Typically: build.ninja.
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include "cmAlgorithms.h"
|
#include "cmAlgorithms.h"
|
||||||
|
|
||||||
cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3(cmake* cm)
|
cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3(cmake* cm)
|
||||||
: cmGlobalGenerator(cm)
|
: cmGlobalCommonGenerator(cm)
|
||||||
{
|
{
|
||||||
// This type of makefile always requires unix style paths
|
// This type of makefile always requires unix style paths
|
||||||
this->ForceUnixPaths = true;
|
this->ForceUnixPaths = true;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#ifndef cmGlobalUnixMakefileGenerator3_h
|
#ifndef cmGlobalUnixMakefileGenerator3_h
|
||||||
#define cmGlobalUnixMakefileGenerator3_h
|
#define cmGlobalUnixMakefileGenerator3_h
|
||||||
|
|
||||||
#include "cmGlobalGenerator.h"
|
#include "cmGlobalCommonGenerator.h"
|
||||||
#include "cmGlobalGeneratorFactory.h"
|
#include "cmGlobalGeneratorFactory.h"
|
||||||
|
|
||||||
class cmGeneratedFileStream;
|
class cmGeneratedFileStream;
|
||||||
|
@ -51,7 +51,7 @@ class cmLocalUnixMakefileGenerator3;
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class cmGlobalUnixMakefileGenerator3 : public cmGlobalGenerator
|
class cmGlobalUnixMakefileGenerator3 : public cmGlobalCommonGenerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalUnixMakefileGenerator3(cmake* cm);
|
cmGlobalUnixMakefileGenerator3(cmake* cm);
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
/*============================================================================
|
||||||
|
CMake - Cross Platform Makefile Generator
|
||||||
|
Copyright 2000-2015 Kitware, Inc., Insight Software Consortium
|
||||||
|
|
||||||
|
Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
see accompanying file Copyright.txt for details.
|
||||||
|
|
||||||
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
See the License for more information.
|
||||||
|
============================================================================*/
|
||||||
|
#include "cmLocalCommonGenerator.h"
|
||||||
|
|
||||||
|
cmLocalCommonGenerator::cmLocalCommonGenerator(cmGlobalGenerator* gg,
|
||||||
|
cmLocalGenerator* parent,
|
||||||
|
cmState::Snapshot snapshot):
|
||||||
|
cmLocalGenerator(gg, parent, snapshot)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
cmLocalCommonGenerator::~cmLocalCommonGenerator()
|
||||||
|
{
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
/*============================================================================
|
||||||
|
CMake - Cross Platform Makefile Generator
|
||||||
|
Copyright 2000-2015 Kitware, Inc., Insight Software Consortium
|
||||||
|
|
||||||
|
Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
see accompanying file Copyright.txt for details.
|
||||||
|
|
||||||
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
See the License for more information.
|
||||||
|
============================================================================*/
|
||||||
|
#ifndef cmLocalCommonGenerator_h
|
||||||
|
#define cmLocalCommonGenerator_h
|
||||||
|
|
||||||
|
#include "cmLocalGenerator.h"
|
||||||
|
|
||||||
|
/** \class cmLocalCommonGenerator
|
||||||
|
* \brief Common infrastructure for Makefile and Ninja local generators.
|
||||||
|
*/
|
||||||
|
class cmLocalCommonGenerator: public cmLocalGenerator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
cmLocalCommonGenerator(cmGlobalGenerator* gg,
|
||||||
|
cmLocalGenerator* parent,
|
||||||
|
cmState::Snapshot snapshot);
|
||||||
|
~cmLocalCommonGenerator();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -25,7 +25,7 @@
|
||||||
cmLocalNinjaGenerator::cmLocalNinjaGenerator(cmGlobalGenerator* gg,
|
cmLocalNinjaGenerator::cmLocalNinjaGenerator(cmGlobalGenerator* gg,
|
||||||
cmLocalGenerator* parent,
|
cmLocalGenerator* parent,
|
||||||
cmState::Snapshot snapshot)
|
cmState::Snapshot snapshot)
|
||||||
: cmLocalGenerator(gg, parent, snapshot)
|
: cmLocalCommonGenerator(gg, parent, snapshot)
|
||||||
, ConfigName("")
|
, ConfigName("")
|
||||||
, HomeRelativeOutputPath("")
|
, HomeRelativeOutputPath("")
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#ifndef cmLocalNinjaGenerator_h
|
#ifndef cmLocalNinjaGenerator_h
|
||||||
# define cmLocalNinjaGenerator_h
|
# define cmLocalNinjaGenerator_h
|
||||||
|
|
||||||
# include "cmLocalGenerator.h"
|
# include "cmLocalCommonGenerator.h"
|
||||||
# include "cmNinjaTypes.h"
|
# include "cmNinjaTypes.h"
|
||||||
|
|
||||||
class cmCustomCommandGenerator;
|
class cmCustomCommandGenerator;
|
||||||
|
@ -28,7 +28,7 @@ class cmake;
|
||||||
* cmLocalNinjaGenerator produces a local build.ninja file from its
|
* cmLocalNinjaGenerator produces a local build.ninja file from its
|
||||||
* member Makefile.
|
* member Makefile.
|
||||||
*/
|
*/
|
||||||
class cmLocalNinjaGenerator : public cmLocalGenerator
|
class cmLocalNinjaGenerator : public cmLocalCommonGenerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmLocalNinjaGenerator(cmGlobalGenerator* gg, cmLocalGenerator* parent,
|
cmLocalNinjaGenerator(cmGlobalGenerator* gg, cmLocalGenerator* parent,
|
||||||
|
|
|
@ -82,7 +82,7 @@ static std::string cmSplitExtension(std::string const& in, std::string& base)
|
||||||
cmLocalUnixMakefileGenerator3::
|
cmLocalUnixMakefileGenerator3::
|
||||||
cmLocalUnixMakefileGenerator3(cmGlobalGenerator* gg, cmLocalGenerator* parent,
|
cmLocalUnixMakefileGenerator3(cmGlobalGenerator* gg, cmLocalGenerator* parent,
|
||||||
cmState::Snapshot snapshot)
|
cmState::Snapshot snapshot)
|
||||||
: cmLocalGenerator(gg, parent, snapshot)
|
: cmLocalCommonGenerator(gg, parent, snapshot)
|
||||||
{
|
{
|
||||||
this->MakefileVariableSize = 0;
|
this->MakefileVariableSize = 0;
|
||||||
this->ColorMakefile = false;
|
this->ColorMakefile = false;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#ifndef cmLocalUnixMakefileGenerator3_h
|
#ifndef cmLocalUnixMakefileGenerator3_h
|
||||||
#define cmLocalUnixMakefileGenerator3_h
|
#define cmLocalUnixMakefileGenerator3_h
|
||||||
|
|
||||||
#include "cmLocalGenerator.h"
|
#include "cmLocalCommonGenerator.h"
|
||||||
|
|
||||||
// for cmDepends::DependencyVector
|
// for cmDepends::DependencyVector
|
||||||
#include "cmDepends.h"
|
#include "cmDepends.h"
|
||||||
|
@ -31,7 +31,7 @@ class cmSourceFile;
|
||||||
* cmLocalUnixMakefileGenerator3 produces a LocalUnix makefile from its
|
* cmLocalUnixMakefileGenerator3 produces a LocalUnix makefile from its
|
||||||
* member Makefile.
|
* member Makefile.
|
||||||
*/
|
*/
|
||||||
class cmLocalUnixMakefileGenerator3 : public cmLocalGenerator
|
class cmLocalUnixMakefileGenerator3 : public cmLocalCommonGenerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmLocalUnixMakefileGenerator3(cmGlobalGenerator* gg,
|
cmLocalUnixMakefileGenerator3(cmGlobalGenerator* gg,
|
||||||
|
|
|
@ -33,7 +33,8 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target)
|
cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target)
|
||||||
: OSXBundleGenerator(0)
|
: cmCommonTargetGenerator()
|
||||||
|
, OSXBundleGenerator(0)
|
||||||
, MacOSXContentGenerator(0)
|
, MacOSXContentGenerator(0)
|
||||||
{
|
{
|
||||||
this->BuildFileStream = 0;
|
this->BuildFileStream = 0;
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
#ifndef cmMakefileTargetGenerator_h
|
#ifndef cmMakefileTargetGenerator_h
|
||||||
#define cmMakefileTargetGenerator_h
|
#define cmMakefileTargetGenerator_h
|
||||||
|
|
||||||
|
#include "cmCommonTargetGenerator.h"
|
||||||
|
|
||||||
#include "cmLocalUnixMakefileGenerator3.h"
|
#include "cmLocalUnixMakefileGenerator3.h"
|
||||||
#include "cmOSXBundleGenerator.h"
|
#include "cmOSXBundleGenerator.h"
|
||||||
|
|
||||||
|
@ -30,7 +32,7 @@ class cmSourceFile;
|
||||||
* \brief Support Routines for writing makefiles
|
* \brief Support Routines for writing makefiles
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class cmMakefileTargetGenerator
|
class cmMakefileTargetGenerator: public cmCommonTargetGenerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// constructor to set the ivars
|
// constructor to set the ivars
|
||||||
|
|
|
@ -58,7 +58,7 @@ cmNinjaTargetGenerator::New(cmGeneratorTarget* target)
|
||||||
}
|
}
|
||||||
|
|
||||||
cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmGeneratorTarget* target)
|
cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmGeneratorTarget* target)
|
||||||
:
|
: cmCommonTargetGenerator(),
|
||||||
MacOSXContentGenerator(0),
|
MacOSXContentGenerator(0),
|
||||||
OSXBundleGenerator(0),
|
OSXBundleGenerator(0),
|
||||||
MacContentFolders(),
|
MacContentFolders(),
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
#ifndef cmNinjaTargetGenerator_h
|
#ifndef cmNinjaTargetGenerator_h
|
||||||
#define cmNinjaTargetGenerator_h
|
#define cmNinjaTargetGenerator_h
|
||||||
|
|
||||||
|
#include "cmCommonTargetGenerator.h"
|
||||||
|
|
||||||
#include "cmStandardIncludes.h"
|
#include "cmStandardIncludes.h"
|
||||||
#include "cmNinjaTypes.h"
|
#include "cmNinjaTypes.h"
|
||||||
#include "cmLocalNinjaGenerator.h"
|
#include "cmLocalNinjaGenerator.h"
|
||||||
|
@ -26,7 +28,7 @@ class cmMakefile;
|
||||||
class cmSourceFile;
|
class cmSourceFile;
|
||||||
class cmCustomCommand;
|
class cmCustomCommand;
|
||||||
|
|
||||||
class cmNinjaTargetGenerator
|
class cmNinjaTargetGenerator: public cmCommonTargetGenerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Create a cmNinjaTargetGenerator according to the @a target's type.
|
/// Create a cmNinjaTargetGenerator according to the @a target's type.
|
||||||
|
|
|
@ -248,6 +248,7 @@ CMAKE_CXX_SOURCES="\
|
||||||
cmCommandArgumentLexer \
|
cmCommandArgumentLexer \
|
||||||
cmCommandArgumentParser \
|
cmCommandArgumentParser \
|
||||||
cmCommandArgumentParserHelper \
|
cmCommandArgumentParserHelper \
|
||||||
|
cmCommonTargetGenerator \
|
||||||
cmCPackPropertiesGenerator \
|
cmCPackPropertiesGenerator \
|
||||||
cmDefinitions \
|
cmDefinitions \
|
||||||
cmDepends \
|
cmDepends \
|
||||||
|
@ -276,8 +277,10 @@ CMAKE_CXX_SOURCES="\
|
||||||
cmGeneratorExpressionNode \
|
cmGeneratorExpressionNode \
|
||||||
cmGeneratorExpressionParser \
|
cmGeneratorExpressionParser \
|
||||||
cmGeneratorExpression \
|
cmGeneratorExpression \
|
||||||
|
cmGlobalCommonGenerator \
|
||||||
cmGlobalGenerator \
|
cmGlobalGenerator \
|
||||||
cmInstallDirectoryGenerator \
|
cmInstallDirectoryGenerator \
|
||||||
|
cmLocalCommonGenerator \
|
||||||
cmLocalGenerator \
|
cmLocalGenerator \
|
||||||
cmInstalledFile \
|
cmInstalledFile \
|
||||||
cmInstallGenerator \
|
cmInstallGenerator \
|
||||||
|
|
Loading…
Reference in New Issue