2016-10-30 18:24:19 +01:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2021-09-14 00:13:48 +02:00
|
|
|
#pragma once
|
2015-11-17 17:22:37 +01:00
|
|
|
|
2018-01-26 17:06:56 +01:00
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
2016-10-30 18:24:19 +01:00
|
|
|
|
2018-04-23 21:13:27 +02:00
|
|
|
#include <map>
|
2016-10-30 18:24:19 +01:00
|
|
|
#include <string>
|
2020-08-30 11:54:41 +02:00
|
|
|
#include <vector>
|
2015-11-17 17:22:37 +01:00
|
|
|
|
2017-04-14 19:02:05 +02:00
|
|
|
#include "cmLocalGenerator.h"
|
|
|
|
|
2016-10-30 18:24:19 +01:00
|
|
|
class cmGeneratorTarget;
|
|
|
|
class cmGlobalGenerator;
|
|
|
|
class cmMakefile;
|
2018-04-23 21:13:27 +02:00
|
|
|
class cmSourceFile;
|
2015-11-17 17:22:37 +01:00
|
|
|
|
|
|
|
/** \class cmLocalCommonGenerator
|
|
|
|
* \brief Common infrastructure for Makefile and Ninja local generators.
|
|
|
|
*/
|
2016-07-09 11:21:54 +02:00
|
|
|
class cmLocalCommonGenerator : public cmLocalGenerator
|
2015-11-17 17:22:37 +01:00
|
|
|
{
|
2021-09-14 00:13:48 +02:00
|
|
|
protected:
|
|
|
|
enum class WorkDir
|
|
|
|
{
|
|
|
|
TopBin,
|
|
|
|
CurBin,
|
|
|
|
};
|
|
|
|
|
2015-11-17 17:22:37 +01:00
|
|
|
public:
|
2021-09-14 00:13:48 +02:00
|
|
|
cmLocalCommonGenerator(cmGlobalGenerator* gg, cmMakefile* mf, WorkDir wd);
|
2018-01-26 17:06:56 +01:00
|
|
|
~cmLocalCommonGenerator() override;
|
2015-11-17 17:22:37 +01:00
|
|
|
|
2020-08-30 11:54:41 +02:00
|
|
|
std::vector<std::string> const& GetConfigNames() const
|
|
|
|
{
|
|
|
|
return this->ConfigNames;
|
|
|
|
}
|
2015-11-17 17:22:37 +01:00
|
|
|
|
2021-09-14 00:13:48 +02:00
|
|
|
std::string const& GetWorkingDirectory() const;
|
|
|
|
|
|
|
|
std::string MaybeRelativeToWorkDir(std::string const& path) const;
|
2016-10-30 18:24:19 +01:00
|
|
|
|
|
|
|
std::string GetTargetFortranFlags(cmGeneratorTarget const* target,
|
2018-01-26 17:06:56 +01:00
|
|
|
std::string const& config) override;
|
2016-10-30 18:24:19 +01:00
|
|
|
|
2018-04-23 21:13:27 +02:00
|
|
|
void ComputeObjectFilenames(
|
|
|
|
std::map<cmSourceFile const*, std::string>& mapping,
|
|
|
|
cmGeneratorTarget const* gt = nullptr) override;
|
|
|
|
|
2015-11-17 17:22:37 +01:00
|
|
|
protected:
|
2021-09-14 00:13:48 +02:00
|
|
|
WorkDir WorkingDirectory;
|
2016-10-30 18:24:19 +01:00
|
|
|
|
2020-08-30 11:54:41 +02:00
|
|
|
std::vector<std::string> ConfigNames;
|
2015-11-17 17:22:37 +01:00
|
|
|
|
|
|
|
friend class cmCommonTargetGenerator;
|
|
|
|
};
|