cmake/Source/cmVisualStudioGeneratorOptions.h

116 lines
3.2 KiB
C
Raw Normal View History

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. */
2009-10-04 10:30:41 +03:00
#ifndef cmVisualStudioGeneratorOptions_h
#define cmVisualStudioGeneratorOptions_h
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;
2009-10-04 10:30:41 +03:00
typedef cmIDEFlagTable cmVS7FlagTable;
class cmVisualStudio10TargetGenerator;
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,
2009-10-04 10:30:41 +03:00
cmVS7FlagTable const* table,
cmVS7FlagTable const* extraTable = 0,
cmVisualStudio10TargetGenerator* g = 0);
2016-07-09 11:21:54 +02:00
cmVisualStudioGeneratorOptions(cmLocalVisualStudioGenerator* lg, Tool tool,
2015-04-27 22:25:09 +02:00
cmVisualStudio10TargetGenerator* g = 0);
// 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.
void Parse(const char* 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
enum CudaRuntime
{
CudaRuntimeStatic,
CudaRuntimeShared,
CudaRuntimeNone
};
CudaRuntime GetCudaRuntime() const;
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.
2016-07-09 11:21:54 +02:00
void OutputPreprocessorDefinitions(std::ostream& fout, const char* prefix,
2011-02-07 16:37:25 +01:00
const char* suffix,
2015-04-27 22:25:09 +02:00
const std::string& lang);
2018-04-23 21:13:27 +02:00
void OutputAdditionalIncludeDirectories(std::ostream& fout,
const char* prefix,
const char* suffix,
const std::string& lang);
2009-10-04 10:30:41 +03:00
void OutputFlagMap(std::ostream& fout, const char* indent);
void SetConfiguration(const char* config);
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;
cmVisualStudio10TargetGenerator* TargetGenerator;
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;
2009-10-04 10:30:41 +03:00
virtual void StoreUnknownFlag(const char* flag);
2017-07-20 19:35:53 +02:00
FlagValue TakeFlag(std::string const& key);
2009-10-04 10:30:41 +03:00
};
#endif