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
|
2009-10-04 10:30:41 +03:00
|
|
|
|
2018-01-26 17:06:56 +01:00
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
2009-10-04 10:30:41 +03:00
|
|
|
|
2017-04-14 19:02:05 +02:00
|
|
|
#include <iosfwd>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "cmGlobalVisualStudioGenerator.h"
|
|
|
|
#include "cmIDEFlagTable.h"
|
2009-10-04 10:30:41 +03:00
|
|
|
#include "cmIDEOptions.h"
|
2017-04-14 19:02:05 +02:00
|
|
|
|
|
|
|
class cmLocalVisualStudioGenerator;
|
|
|
|
|
2020-02-01 23:06:01 +01:00
|
|
|
using cmVS7FlagTable = cmIDEFlagTable;
|
2009-10-04 10:30:41 +03:00
|
|
|
|
2016-07-09 11:21:54 +02:00
|
|
|
class cmVisualStudioGeneratorOptions : public cmIDEOptions
|
2009-10-04 10:30:41 +03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Construct an options table for a given tool.
|
|
|
|
enum Tool
|
|
|
|
{
|
|
|
|
Compiler,
|
2015-04-27 22:25:09 +02:00
|
|
|
ResourceCompiler,
|
2017-07-20 19:35:53 +02:00
|
|
|
CudaCompiler,
|
2015-04-27 22:25:09 +02:00
|
|
|
MasmCompiler,
|
2017-07-20 19:35:53 +02:00
|
|
|
NasmCompiler,
|
2009-10-04 10:30:41 +03:00
|
|
|
Linker,
|
2017-04-14 19:02:05 +02:00
|
|
|
FortranCompiler,
|
|
|
|
CSharpCompiler
|
2009-10-04 10:30:41 +03:00
|
|
|
};
|
2016-07-09 11:21:54 +02:00
|
|
|
cmVisualStudioGeneratorOptions(cmLocalVisualStudioGenerator* lg, Tool tool,
|
2018-08-09 18:06:22 +02:00
|
|
|
cmVS7FlagTable const* table = nullptr,
|
|
|
|
cmVS7FlagTable const* extraTable = nullptr);
|
2015-04-27 22:25:09 +02:00
|
|
|
|
|
|
|
// Add a table of flags.
|
|
|
|
void AddTable(cmVS7FlagTable const* table);
|
|
|
|
|
2017-07-20 19:35:53 +02:00
|
|
|
// Clear the flag tables.
|
|
|
|
void ClearTables();
|
|
|
|
|
2009-10-04 10:30:41 +03:00
|
|
|
// Store options from command line flags.
|
2018-10-28 12:09:07 +01:00
|
|
|
void Parse(const std::string& flags);
|
2011-01-16 11:35:12 +01:00
|
|
|
void ParseFinish();
|
2009-10-04 10:30:41 +03:00
|
|
|
|
2017-07-20 19:35:53 +02:00
|
|
|
void PrependInheritedString(std::string const& key);
|
|
|
|
|
|
|
|
// Parse the content of the given flag table entry again to extract
|
|
|
|
// known flags and leave the rest in the original entry.
|
|
|
|
void Reparse(std::string const& key);
|
|
|
|
|
2009-10-04 10:30:41 +03:00
|
|
|
// Fix the ExceptionHandling option to default to off.
|
|
|
|
void FixExceptionHandlingDefault();
|
|
|
|
|
|
|
|
// Store options for verbose builds.
|
|
|
|
void SetVerboseMakefile(bool verbose);
|
|
|
|
|
|
|
|
// Check for specific options.
|
2013-11-03 12:27:13 +02:00
|
|
|
bool UsingUnicode() const;
|
|
|
|
bool UsingSBCS() const;
|
2009-10-04 10:30:41 +03:00
|
|
|
|
2017-07-20 19:35:53 +02:00
|
|
|
void FixCudaCodeGeneration();
|
|
|
|
|
2018-01-26 17:06:56 +01:00
|
|
|
void FixManifestUACFlags();
|
|
|
|
|
2013-11-03 12:27:13 +02:00
|
|
|
bool IsDebug() const;
|
2015-04-27 22:25:09 +02:00
|
|
|
bool IsWinRt() const;
|
2017-04-14 19:02:05 +02:00
|
|
|
bool IsManaged() const;
|
2009-10-04 10:30:41 +03:00
|
|
|
// Write options to output.
|
2018-08-09 18:06:22 +02:00
|
|
|
void OutputPreprocessorDefinitions(std::ostream& fout, int indent,
|
2015-04-27 22:25:09 +02:00
|
|
|
const std::string& lang);
|
2018-08-09 18:06:22 +02:00
|
|
|
void OutputAdditionalIncludeDirectories(std::ostream& fout, int indent,
|
2018-04-23 21:13:27 +02:00
|
|
|
const std::string& lang);
|
2018-08-09 18:06:22 +02:00
|
|
|
void OutputFlagMap(std::ostream& fout, int indent);
|
|
|
|
void SetConfiguration(const std::string& config);
|
|
|
|
const std::string& GetConfiguration() const;
|
|
|
|
|
|
|
|
protected:
|
2020-08-30 11:54:41 +02:00
|
|
|
virtual void OutputFlag(std::ostream& fout, int indent,
|
|
|
|
const std::string& tag,
|
2018-08-09 18:06:22 +02:00
|
|
|
const std::string& content) = 0;
|
2016-07-09 11:21:54 +02:00
|
|
|
|
2009-10-04 10:30:41 +03:00
|
|
|
private:
|
2012-02-18 12:40:36 +02:00
|
|
|
cmLocalVisualStudioGenerator* LocalGenerator;
|
2015-08-17 11:37:30 +02:00
|
|
|
cmGlobalVisualStudioGenerator::VSVersion Version;
|
2009-10-04 10:30:41 +03:00
|
|
|
|
|
|
|
std::string Configuration;
|
|
|
|
Tool CurrentTool;
|
|
|
|
|
2011-01-16 11:35:12 +01:00
|
|
|
bool FortranRuntimeDebug;
|
|
|
|
bool FortranRuntimeDLL;
|
|
|
|
bool FortranRuntimeMT;
|
|
|
|
|
2017-07-20 19:35:53 +02:00
|
|
|
std::string UnknownFlagField;
|
|
|
|
|
2018-08-09 18:06:22 +02:00
|
|
|
void StoreUnknownFlag(std::string const& flag) override;
|
2017-07-20 19:35:53 +02:00
|
|
|
|
|
|
|
FlagValue TakeFlag(std::string const& key);
|
2009-10-04 10:30:41 +03:00
|
|
|
};
|