2015-07-07 23:37:56 +03:00
|
|
|
/*============================================================================
|
|
|
|
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
|
|
|
|
|
2016-08-18 01:24:24 +03:00
|
|
|
#include <cmConfigure.h> // IWYU pragma: keep
|
2015-07-07 23:37:56 +03:00
|
|
|
|
2016-08-18 01:24:24 +03:00
|
|
|
#include "cmOutputConverter.h"
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2015-07-08 22:49:03 +03:00
|
|
|
|
2015-07-08 18:13:11 +03:00
|
|
|
class cmGeneratorTarget;
|
|
|
|
class cmGlobalCommonGenerator;
|
|
|
|
class cmLocalCommonGenerator;
|
|
|
|
class cmMakefile;
|
2015-07-08 22:52:42 +03:00
|
|
|
class cmSourceFile;
|
2015-07-08 18:13:11 +03:00
|
|
|
|
2015-07-07 23:37:56 +03:00
|
|
|
/** \class cmCommonTargetGenerator
|
|
|
|
* \brief Common infrastructure for Makefile and Ninja per-target generators
|
|
|
|
*/
|
|
|
|
class cmCommonTargetGenerator
|
|
|
|
{
|
|
|
|
public:
|
2016-06-16 17:54:20 +03:00
|
|
|
cmCommonTargetGenerator(cmGeneratorTarget* gt);
|
2015-07-07 23:37:56 +03:00
|
|
|
virtual ~cmCommonTargetGenerator();
|
2015-07-08 18:13:11 +03:00
|
|
|
|
2015-07-08 22:02:11 +03:00
|
|
|
std::string const& GetConfigName() const;
|
|
|
|
|
2015-07-08 18:13:11 +03:00
|
|
|
protected:
|
2015-07-08 21:49:04 +03:00
|
|
|
// Add language feature flags.
|
|
|
|
void AddFeatureFlags(std::string& flags, const std::string& lang);
|
|
|
|
|
|
|
|
// Feature query methods.
|
|
|
|
const char* GetFeature(const std::string& feature);
|
|
|
|
bool GetFeatureAsBool(const std::string& feature);
|
|
|
|
|
2015-07-08 22:24:17 +03:00
|
|
|
// Helper to add flag for windows .def file.
|
|
|
|
void AddModuleDefinitionFlag(std::string& flags);
|
|
|
|
|
2015-07-08 18:13:11 +03:00
|
|
|
cmGeneratorTarget* GeneratorTarget;
|
|
|
|
cmMakefile* Makefile;
|
|
|
|
cmLocalCommonGenerator* LocalGenerator;
|
|
|
|
cmGlobalCommonGenerator* GlobalGenerator;
|
2015-07-08 22:02:11 +03:00
|
|
|
std::string ConfigName;
|
2015-07-08 22:24:17 +03:00
|
|
|
|
|
|
|
// The windows module definition source file (.def), if any.
|
2015-11-02 17:24:25 +03:00
|
|
|
cmSourceFile const* ModuleDefinitionFile;
|
2015-07-08 22:49:03 +03:00
|
|
|
|
2016-08-27 14:44:57 +03:00
|
|
|
std::string Convert(std::string const& source,
|
|
|
|
cmOutputConverter::RelativeRoot relative,
|
|
|
|
cmOutputConverter::OutputFormat output);
|
2015-07-08 22:52:42 +03:00
|
|
|
|
|
|
|
void AppendFortranFormatFlags(std::string& flags,
|
|
|
|
cmSourceFile const& source);
|
2015-07-08 23:38:49 +03:00
|
|
|
|
2015-07-09 17:05:12 +03:00
|
|
|
virtual void AddIncludeFlags(std::string& flags,
|
|
|
|
std::string const& lang) = 0;
|
|
|
|
|
2016-02-20 22:35:18 +03:00
|
|
|
void AppendOSXVerFlag(std::string& flags, const std::string& lang,
|
|
|
|
const char* name, bool so);
|
|
|
|
|
2015-07-09 17:05:12 +03:00
|
|
|
typedef std::map<std::string, std::string> ByLanguageMap;
|
2016-05-16 17:34:04 +03:00
|
|
|
std::string GetFlags(const std::string& l);
|
2015-07-09 17:05:12 +03:00
|
|
|
ByLanguageMap FlagsByLanguage;
|
2016-05-16 17:34:04 +03:00
|
|
|
std::string GetDefines(const std::string& l);
|
2015-07-09 17:10:25 +03:00
|
|
|
ByLanguageMap DefinesByLanguage;
|
2015-07-13 17:35:04 +03:00
|
|
|
std::string GetIncludes(std::string const& l);
|
|
|
|
ByLanguageMap IncludesByLanguage;
|
2015-09-16 17:24:16 +03:00
|
|
|
std::string GetManifests();
|
2015-07-28 21:05:34 +03:00
|
|
|
|
|
|
|
std::vector<std::string> GetLinkedTargetDirectories() const;
|
2015-07-07 23:37:56 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|