2016-09-27 19:01:08 +00:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2015-07-07 20:37:56 +00:00
|
|
|
#ifndef cmCommonTargetGenerator_h
|
|
|
|
#define cmCommonTargetGenerator_h
|
|
|
|
|
2016-08-17 22:24:24 +00:00
|
|
|
#include <cmConfigure.h> // IWYU pragma: keep
|
2017-04-11 19:42:35 +00:00
|
|
|
|
2016-08-17 22:24:24 +00:00
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2015-07-08 19:49:03 +00:00
|
|
|
|
2015-07-08 15:13:11 +00:00
|
|
|
class cmGeneratorTarget;
|
|
|
|
class cmGlobalCommonGenerator;
|
2016-11-05 20:40:14 +00:00
|
|
|
class cmLinkLineComputer;
|
2015-07-08 15:13:11 +00:00
|
|
|
class cmLocalCommonGenerator;
|
|
|
|
class cmMakefile;
|
2015-07-08 19:52:42 +00:00
|
|
|
class cmSourceFile;
|
2015-07-08 15:13:11 +00:00
|
|
|
|
2015-07-07 20:37:56 +00:00
|
|
|
/** \class cmCommonTargetGenerator
|
|
|
|
* \brief Common infrastructure for Makefile and Ninja per-target generators
|
|
|
|
*/
|
|
|
|
class cmCommonTargetGenerator
|
|
|
|
{
|
|
|
|
public:
|
2016-06-16 14:54:20 +00:00
|
|
|
cmCommonTargetGenerator(cmGeneratorTarget* gt);
|
2015-07-07 20:37:56 +00:00
|
|
|
virtual ~cmCommonTargetGenerator();
|
2015-07-08 15:13:11 +00:00
|
|
|
|
2015-07-08 19:02:11 +00:00
|
|
|
std::string const& GetConfigName() const;
|
|
|
|
|
2015-07-08 15:13:11 +00:00
|
|
|
protected:
|
2015-07-08 18:49:04 +00:00
|
|
|
// Add language feature flags.
|
|
|
|
void AddFeatureFlags(std::string& flags, const std::string& lang);
|
|
|
|
|
|
|
|
// Feature query methods.
|
|
|
|
const char* GetFeature(const std::string& feature);
|
|
|
|
|
2015-07-08 19:24:17 +00:00
|
|
|
// Helper to add flag for windows .def file.
|
2016-10-08 10:21:36 +00:00
|
|
|
void AddModuleDefinitionFlag(cmLinkLineComputer* linkLineComputer,
|
|
|
|
std::string& flags);
|
2015-07-08 19:24:17 +00:00
|
|
|
|
2015-07-08 15:13:11 +00:00
|
|
|
cmGeneratorTarget* GeneratorTarget;
|
|
|
|
cmMakefile* Makefile;
|
|
|
|
cmLocalCommonGenerator* LocalGenerator;
|
|
|
|
cmGlobalCommonGenerator* GlobalGenerator;
|
2015-07-08 19:02:11 +00:00
|
|
|
std::string ConfigName;
|
2015-07-08 19:24:17 +00:00
|
|
|
|
2015-07-08 19:52:42 +00:00
|
|
|
void AppendFortranFormatFlags(std::string& flags,
|
|
|
|
cmSourceFile const& source);
|
2015-07-08 20:38:49 +00:00
|
|
|
|
2015-07-09 14:05:12 +00:00
|
|
|
virtual void AddIncludeFlags(std::string& flags,
|
|
|
|
std::string const& lang) = 0;
|
|
|
|
|
2016-02-20 19:35:18 +00:00
|
|
|
void AppendOSXVerFlag(std::string& flags, const std::string& lang,
|
|
|
|
const char* name, bool so);
|
|
|
|
|
2015-07-09 14:05:12 +00:00
|
|
|
typedef std::map<std::string, std::string> ByLanguageMap;
|
2016-05-16 14:34:04 +00:00
|
|
|
std::string GetFlags(const std::string& l);
|
2015-07-09 14:05:12 +00:00
|
|
|
ByLanguageMap FlagsByLanguage;
|
2016-05-16 14:34:04 +00:00
|
|
|
std::string GetDefines(const std::string& l);
|
2015-07-09 14:10:25 +00:00
|
|
|
ByLanguageMap DefinesByLanguage;
|
2015-07-13 14:35:04 +00:00
|
|
|
std::string GetIncludes(std::string const& l);
|
|
|
|
ByLanguageMap IncludesByLanguage;
|
2015-09-16 14:24:16 +00:00
|
|
|
std::string GetManifests();
|
2015-07-28 18:05:34 +00:00
|
|
|
|
|
|
|
std::vector<std::string> GetLinkedTargetDirectories() const;
|
2016-12-15 21:15:28 +00:00
|
|
|
std::string ComputeTargetCompilePDB() const;
|
2015-07-07 20:37:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|