cmake/Source/cmake.h

652 lines
24 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. */
#ifndef cmake_h
#define cmake_h
2018-01-26 17:06:56 +01:00
#include "cmConfigure.h" // IWYU pragma: keep
2016-07-09 11:21:54 +02:00
2016-10-30 18:24:19 +01:00
#include <map>
#include <set>
#include <string>
2018-04-23 21:13:27 +02:00
#include <unordered_set>
2016-10-30 18:24:19 +01:00
#include <vector>
2017-04-14 19:02:05 +02:00
#include "cmInstalledFile.h"
#include "cmListFileCache.h"
#include "cmStateSnapshot.h"
#include "cmStateTypes.h"
2016-10-30 18:24:19 +01:00
#if defined(CMAKE_BUILD_WITH_CMAKE)
2018-08-09 18:06:22 +02:00
# include "cm_jsoncpp_value.h"
2016-10-30 18:24:19 +01:00
#endif
class cmExternalMakefileProjectGeneratorFactory;
class cmFileTimeComparison;
class cmGlobalGenerator;
2016-10-30 18:24:19 +01:00
class cmGlobalGeneratorFactory;
class cmMakefile;
2016-10-30 18:24:19 +01:00
class cmMessenger;
2017-04-14 19:02:05 +02:00
class cmState;
class cmVariableWatch;
2016-10-30 18:24:19 +01:00
struct cmDocumentationEntry;
2012-04-19 19:04:21 +03:00
/** \brief Represents a cmake invocation.
*
* This class represents a cmake invocation. It is the top level class when
2013-11-03 12:27:13 +02:00
* running cmake. Most cmake based GUIs should primarily create an instance
2012-04-19 19:04:21 +03:00
* of this class and communicate with it.
*
* The basic process for a GUI is as follows:
*
* -# Create a cmake instance
2015-08-17 11:37:30 +02:00
* -# Set the Home directories, generator, and cmake command. this
2012-04-19 19:04:21 +03:00
* can be done using the Set methods or by using SetArgs and passing in
* command line arguments.
* -# Load the cache by calling LoadCache (duh)
* -# if you are using command line arguments with -D or -C flags then
* call SetCacheArgs (or if for some other reason you want to modify the
* cache), do it now.
* -# Finally call Configure
* -# Let the user change values and go back to step 5
* -# call Generate
2015-08-17 11:37:30 +02:00
* If your GUI allows the user to change the home directories then
2012-04-19 19:04:21 +03:00
* you must at a minimum redo steps 2 through 7.
*/
class cmake
{
2017-07-20 19:35:53 +02:00
CM_DISABLE_COPY(cmake)
2016-07-09 11:21:54 +02:00
public:
2017-07-20 19:35:53 +02:00
enum Role
{
RoleInternal, // no commands
RoleScript, // script commands
RoleProject // all commands
};
enum MessageType
2016-07-09 11:21:54 +02:00
{
AUTHOR_WARNING,
2016-03-13 13:35:51 +01:00
AUTHOR_ERROR,
FATAL_ERROR,
INTERNAL_ERROR,
MESSAGE,
WARNING,
2014-08-03 19:52:23 +02:00
LOG,
DEPRECATION_ERROR,
DEPRECATION_WARNING
};
2012-02-18 12:40:36 +02:00
2016-03-13 13:35:51 +01:00
enum DiagLevel
{
DIAG_IGNORE,
DIAG_WARN,
DIAG_ERROR
};
2012-02-18 12:40:36 +02:00
2012-04-19 19:04:21 +03:00
/** \brief Describes the working modes of cmake */
2012-02-18 12:40:36 +02:00
enum WorkingMode
{
2012-04-19 19:04:21 +03:00
NORMAL_MODE, ///< Cmake runs to create project files
2016-07-09 11:21:54 +02:00
/** \brief Script mode (started by using -P).
*
* In script mode there is no generator and no cache. Also,
* languages are not enabled, so add_executable and things do
* nothing.
*/
2012-02-18 12:40:36 +02:00
SCRIPT_MODE,
2012-04-19 19:04:21 +03:00
/** \brief A pkg-config like mode
*
* In this mode cmake just searches for a package and prints the results to
* stdout. This is similar to SCRIPT_MODE, but commands like add_library()
* work too, since they may be used e.g. in exported target files. Started
* via --find-package.
*/
2012-02-18 12:40:36 +02:00
FIND_PACKAGE_MODE
};
2016-03-13 13:35:51 +01:00
struct GeneratorInfo
2016-07-09 11:21:54 +02:00
{
2016-03-13 13:35:51 +01:00
std::string name;
2016-10-30 18:24:19 +01:00
std::string baseName;
std::string extraName;
2016-03-13 13:35:51 +01:00
bool supportsToolset;
2016-10-30 18:24:19 +01:00
bool supportsPlatform;
bool isAlias;
2016-07-09 11:21:54 +02:00
};
2016-03-13 13:35:51 +01:00
2015-04-27 22:25:09 +02:00
typedef std::map<std::string, cmInstalledFile> InstalledFilesMap;
2018-08-09 18:06:22 +02:00
static const int NO_BUILD_PARALLEL_LEVEL = -1;
static const int DEFAULT_BUILD_PARALLEL_LEVEL = 0;
2012-04-19 19:04:21 +03:00
/// Default constructor
2017-07-20 19:35:53 +02:00
cmake(Role role);
2012-04-19 19:04:21 +03:00
/// Destructor
~cmake();
2016-10-30 18:24:19 +01:00
#if defined(CMAKE_BUILD_WITH_CMAKE)
Json::Value ReportCapabilitiesJson(bool haveServerMode) const;
#endif
std::string ReportCapabilities(bool haveServerMode) const;
2016-07-09 11:21:54 +02:00
static const char* GetCMakeFilesDirectory() { return "/CMakeFiles"; }
static const char* GetCMakeFilesDirectoryPostSlash()
{
return "CMakeFiles/";
}
2011-01-16 11:35:12 +01:00
//@{
/**
* Set/Get the home directory (or output directory) in the project. The
2012-04-19 19:04:21 +03:00
* home directory is the top directory of the project. It is the
2015-08-17 11:37:30 +02:00
* path-to-source cmake was run with.
*/
2015-04-27 22:25:09 +02:00
void SetHomeDirectory(const std::string& dir);
2018-04-23 21:13:27 +02:00
std::string const& GetHomeDirectory() const;
2015-08-17 11:37:30 +02:00
void SetHomeOutputDirectory(const std::string& dir);
2018-04-23 21:13:27 +02:00
std::string const& GetHomeOutputDirectory() const;
//@}
/**
* Handle a command line invocation of cmake.
*/
2016-07-09 11:21:54 +02:00
int Run(const std::vector<std::string>& args)
{
return this->Run(args, false);
}
int Run(const std::vector<std::string>& args, bool noconfigure);
/**
* Run the global generator Generate step.
*/
int Generate();
/**
* Configure the cmMakefiles. This routine will create a GlobalGenerator if
* one has not already been set. It will then Call Configure on the
* GlobalGenerator. This in turn will read in an process all the CMakeList
* files for the tree. It will not produce any actual Makefiles, or
* workspaces. Generate does that. */
int Configure();
int ActualConfigure();
2015-08-17 11:37:30 +02:00
///! Break up a line like VAR:type="value" into var, type and value
2016-07-09 11:21:54 +02:00
static bool ParseCacheEntry(const std::string& entry, std::string& var,
std::string& value,
2017-04-14 19:02:05 +02:00
cmStateEnums::CacheEntryType& type);
2015-08-17 11:37:30 +02:00
int LoadCache();
2015-08-17 11:37:30 +02:00
bool LoadCache(const std::string& path);
bool LoadCache(const std::string& path, bool internal,
std::set<std::string>& excludes,
std::set<std::string>& includes);
bool SaveCache(const std::string& path);
bool DeleteCache(const std::string& path);
void PreLoadCMakeFiles();
///! Create a GlobalGenerator
2015-04-27 22:25:09 +02:00
cmGlobalGenerator* CreateGlobalGenerator(const std::string& name);
///! Return the global generator assigned to this instance of cmake
2016-07-09 11:21:54 +02:00
cmGlobalGenerator* GetGlobalGenerator() { return this->GlobalGenerator; }
///! Return the global generator assigned to this instance of cmake, const
2011-01-16 11:35:12 +01:00
const cmGlobalGenerator* GetGlobalGenerator() const
2016-07-09 11:21:54 +02:00
{
return this->GlobalGenerator;
}
2016-10-30 18:24:19 +01:00
///! Return the full path to where the CMakeCache.txt file should be.
static std::string FindCacheFile(const std::string& binaryDir);
///! Return the global generator assigned to this instance of cmake
2016-07-09 11:21:54 +02:00
void SetGlobalGenerator(cmGlobalGenerator*);
///! Get the names of the current registered generators
2016-10-30 18:24:19 +01:00
void GetRegisteredGenerators(std::vector<GeneratorInfo>& generators) const;
2018-04-23 21:13:27 +02:00
///! Set the name of the selected generator-specific instance.
void SetGeneratorInstance(std::string const& instance)
{
this->GeneratorInstance = instance;
}
2015-04-27 22:25:09 +02:00
///! Set the name of the selected generator-specific platform.
void SetGeneratorPlatform(std::string const& ts)
2016-07-09 11:21:54 +02:00
{
this->GeneratorPlatform = ts;
}
2015-04-27 22:25:09 +02:00
2013-03-16 19:13:01 +02:00
///! Set the name of the selected generator-specific toolset.
void SetGeneratorToolset(std::string const& ts)
2016-07-09 11:21:54 +02:00
{
this->GeneratorToolset = ts;
}
2013-03-16 19:13:01 +02:00
2016-03-13 13:35:51 +01:00
const std::vector<std::string>& GetSourceExtensions() const
2016-07-09 11:21:54 +02:00
{
return this->SourceFileExtensions;
}
2018-04-23 21:13:27 +02:00
bool IsSourceExtension(const std::string& ext) const
{
return this->SourceFileExtensionsSet.find(ext) !=
this->SourceFileExtensionsSet.end();
}
2016-03-13 13:35:51 +01:00
const std::vector<std::string>& GetHeaderExtensions() const
2016-07-09 11:21:54 +02:00
{
return this->HeaderFileExtensions;
}
2016-03-13 13:35:51 +01:00
2018-04-23 21:13:27 +02:00
bool IsHeaderExtension(const std::string& ext) const
{
return this->HeaderFileExtensionsSet.find(ext) !=
this->HeaderFileExtensionsSet.end();
}
// Strips the extension (if present and known) from a filename
std::string StripExtension(const std::string& file) const;
/**
* Given a variable name, return its value (as a string).
*/
2015-04-27 22:25:09 +02:00
const char* GetCacheDefinition(const std::string&) const;
///! Add an entry into the cache
2015-04-27 22:25:09 +02:00
void AddCacheEntry(const std::string& key, const char* value,
2016-07-09 11:21:54 +02:00
const char* helpString, int type);
2018-08-09 18:06:22 +02:00
bool DoWriteGlobVerifyTarget() const;
std::string const& GetGlobVerifyScript() const;
std::string const& GetGlobVerifyStamp() const;
void AddGlobCacheEntry(bool recurse, bool listDirectories,
bool followSymlinks, const std::string& relative,
const std::string& expression,
const std::vector<std::string>& files,
const std::string& variable,
cmListFileBacktrace const& bt);
2011-01-16 11:35:12 +01:00
/**
* Get the system information and write it to the file specified
*/
int GetSystemInformation(std::vector<std::string>&);
///! Parse command line arguments
2011-02-07 16:37:25 +01:00
void SetArgs(const std::vector<std::string>&,
bool directoriesSetBefore = false);
///! Is this cmake running as a result of a TRY_COMPILE command
2015-08-17 11:37:30 +02:00
bool GetIsInTryCompile() const;
void SetIsInTryCompile(bool b);
2011-01-16 11:35:12 +01:00
///! Parse command line arguments that might set cache values
bool SetCacheArgs(const std::vector<std::string>&);
2016-07-09 11:21:54 +02:00
typedef void (*ProgressCallbackType)(const char* msg, float progress, void*);
/**
2013-11-03 12:27:13 +02:00
* Set the function used by GUIs to receive progress updates
2011-01-16 11:35:12 +01:00
* Function gets passed: message as a const char*, a progress
* amount ranging from 0 to 1.0 and client data. The progress
2011-01-16 11:35:12 +01:00
* number provided may be negative in cases where a message is
* to be displayed without any progress percentage.
*/
2018-01-26 17:06:56 +01:00
void SetProgressCallback(ProgressCallbackType f, void* clientData = nullptr);
///! this is called by generators to update the progress
2016-07-09 11:21:54 +02:00
void UpdateProgress(const char* msg, float prog);
///! Get the variable watch object
cmVariableWatch* GetVariableWatch() { return this->VariableWatch; }
void GetGeneratorDocumentation(std::vector<cmDocumentationEntry>&);
///! Set/Get a property of this target file
2016-07-09 11:21:54 +02:00
void SetProperty(const std::string& prop, const char* value);
void AppendProperty(const std::string& prop, const char* value,
bool asString = false);
const char* GetProperty(const std::string& prop);
2015-04-27 22:25:09 +02:00
bool GetPropertyAsBool(const std::string& prop);
2015-04-27 22:25:09 +02:00
///! Get or create an cmInstalledFile instance and return a pointer to it
2016-07-09 11:21:54 +02:00
cmInstalledFile* GetOrCreateInstalledFile(cmMakefile* mf,
const std::string& name);
2015-04-27 22:25:09 +02:00
cmInstalledFile const* GetInstalledFile(const std::string& name) const;
InstalledFilesMap const& GetInstalledFiles() const
2016-07-09 11:21:54 +02:00
{
return this->InstalledFiles;
}
///! Do all the checks before running configure
int DoPreConfigureChecks();
2012-02-18 12:40:36 +02:00
void SetWorkingMode(WorkingMode mode) { this->CurrentWorkingMode = mode; }
WorkingMode GetWorkingMode() { return this->CurrentWorkingMode; }
2011-01-16 11:35:12 +01:00
2012-04-19 19:04:21 +03:00
///! Debug the try compile stuff by not deleting the files
2016-07-09 11:21:54 +02:00
bool GetDebugTryCompile() { return this->DebugTryCompile; }
void DebugTryCompileOn() { this->DebugTryCompile = true; }
/**
* Generate CMAKE_ROOT and CMAKE_COMMAND cache entries
*/
int AddCMakePaths();
/**
* Get the file comparison class
*/
cmFileTimeComparison* GetFileComparison() { return this->FileComparison; }
// Do we want debug output during the cmake run.
bool GetDebugOutput() { return this->DebugOutput; }
2016-07-09 11:21:54 +02:00
void SetDebugOutputOn(bool b) { this->DebugOutput = b; }
// Do we want trace output during the cmake run.
2016-07-09 11:21:54 +02:00
bool GetTrace() { return this->Trace; }
void SetTrace(bool b) { this->Trace = b; }
bool GetTraceExpand() { return this->TraceExpand; }
void SetTraceExpand(bool b) { this->TraceExpand = b; }
2016-10-30 18:24:19 +01:00
void AddTraceSource(std::string const& file)
{
this->TraceOnlyThisSources.push_back(file);
}
std::vector<std::string> const& GetTraceSources() const
{
return this->TraceOnlyThisSources;
}
2016-07-09 11:21:54 +02:00
bool GetWarnUninitialized() { return this->WarnUninitialized; }
void SetWarnUninitialized(bool b) { this->WarnUninitialized = b; }
bool GetWarnUnused() { return this->WarnUnused; }
void SetWarnUnused(bool b) { this->WarnUnused = b; }
bool GetWarnUnusedCli() { return this->WarnUnusedCli; }
void SetWarnUnusedCli(bool b) { this->WarnUnusedCli = b; }
bool GetCheckSystemVars() { return this->CheckSystemVars; }
void SetCheckSystemVars(bool b) { this->CheckSystemVars = b; }
2011-02-07 16:37:25 +01:00
void MarkCliAsUsed(const std::string& variable);
/** Get the list of configurations (in upper case) considered to be
debugging configurations.*/
2015-08-17 11:37:30 +02:00
std::vector<std::string> GetDebugConfigs();
2014-08-03 19:52:23 +02:00
void SetCMakeEditCommand(std::string const& s)
2016-07-09 11:21:54 +02:00
{
this->CMakeEditCommand = s;
}
2014-08-03 19:52:23 +02:00
std::string const& GetCMakeEditCommand() const
2016-07-09 11:21:54 +02:00
{
return this->CMakeEditCommand;
}
2016-10-30 18:24:19 +01:00
cmMessenger* GetMessenger() const;
2016-03-13 13:35:51 +01:00
/*
* Get the state of the suppression of developer (author) warnings.
* Returns false, by default, if developer warnings should be shown, true
* otherwise.
*/
2016-10-30 18:24:19 +01:00
bool GetSuppressDevWarnings() const;
2016-03-13 13:35:51 +01:00
/*
* Set the state of the suppression of developer (author) warnings.
*/
void SetSuppressDevWarnings(bool v);
/*
* Get the state of the suppression of deprecated warnings.
* Returns false, by default, if deprecated warnings should be shown, true
* otherwise.
*/
2016-10-30 18:24:19 +01:00
bool GetSuppressDeprecatedWarnings() const;
2016-03-13 13:35:51 +01:00
/*
* Set the state of the suppression of deprecated warnings.
*/
void SetSuppressDeprecatedWarnings(bool v);
/*
* Get the state of treating developer (author) warnings as errors.
* Returns false, by default, if warnings should not be treated as errors,
* true otherwise.
*/
2016-10-30 18:24:19 +01:00
bool GetDevWarningsAsErrors() const;
2016-03-13 13:35:51 +01:00
/**
* Set the state of treating developer (author) warnings as errors.
*/
void SetDevWarningsAsErrors(bool v);
/*
* Get the state of treating deprecated warnings as errors.
* Returns false, by default, if warnings should not be treated as errors,
* true otherwise.
*/
2016-10-30 18:24:19 +01:00
bool GetDeprecatedWarningsAsErrors() const;
2016-03-13 13:35:51 +01:00
/**
* Set the state of treating developer (author) warnings as errors.
*/
void SetDeprecatedWarningsAsErrors(bool v);
/** Display a message to the user. */
2016-07-09 11:21:54 +02:00
void IssueMessage(
cmake::MessageType t, std::string const& text,
2016-10-30 18:24:19 +01:00
cmListFileBacktrace const& backtrace = cmListFileBacktrace()) const;
2015-08-17 11:37:30 +02:00
2012-04-19 19:04:21 +03:00
///! run the --build option
2018-08-09 18:06:22 +02:00
int Build(int jobs, const std::string& dir, const std::string& target,
2009-10-04 10:30:41 +03:00
const std::string& config,
2016-07-09 11:21:54 +02:00
const std::vector<std::string>& nativeOptions, bool clean);
2011-02-07 16:37:25 +01:00
2018-04-23 21:13:27 +02:00
///! run the --open option
bool Open(const std::string& dir, bool dryRun);
2015-04-27 22:25:09 +02:00
void UnwatchUnusedCli(const std::string& var);
void WatchUnusedCli(const std::string& var);
2015-08-17 11:37:30 +02:00
cmState* GetState() const { return this->State; }
2017-07-20 19:35:53 +02:00
void SetCurrentSnapshot(cmStateSnapshot const& snapshot)
2016-07-09 11:21:54 +02:00
{
this->CurrentSnapshot = snapshot;
}
2017-04-14 19:02:05 +02:00
cmStateSnapshot GetCurrentSnapshot() const { return this->CurrentSnapshot; }
2015-08-17 11:37:30 +02:00
protected:
2011-06-19 15:41:06 +03:00
void RunCheckForUnusedVariables();
void InitializeProperties();
2015-04-27 22:25:09 +02:00
int HandleDeleteCacheVariables(const std::string& var);
2013-03-16 19:13:01 +02:00
typedef std::vector<cmGlobalGeneratorFactory*> RegisteredGeneratorsVector;
RegisteredGeneratorsVector Generators;
2016-10-30 18:24:19 +01:00
typedef std::vector<cmExternalMakefileProjectGeneratorFactory*>
RegisteredExtraGeneratorsVector;
RegisteredExtraGeneratorsVector ExtraGenerators;
2017-07-20 19:35:53 +02:00
void AddScriptingCommands();
void AddProjectCommands();
void AddDefaultGenerators();
void AddDefaultExtraGenerators();
2016-07-09 11:21:54 +02:00
cmGlobalGenerator* GlobalGenerator;
2016-03-13 13:35:51 +01:00
std::map<std::string, DiagLevel> DiagLevels;
2018-04-23 21:13:27 +02:00
std::string GeneratorInstance;
2015-04-27 22:25:09 +02:00
std::string GeneratorPlatform;
2013-03-16 19:13:01 +02:00
std::string GeneratorToolset;
///! read in a cmake list file to initialize the cache
2016-07-09 11:21:54 +02:00
void ReadListFile(const std::vector<std::string>& args, const char* path);
2012-02-18 12:40:36 +02:00
bool FindPackage(const std::vector<std::string>& args);
///! Check if CMAKE_CACHEFILE_DIR is set. If it is not, delete the log file.
/// If it is set, truncate it to 50kb
void TruncateOutputLog(const char* fname);
2011-01-16 11:35:12 +01:00
/**
* Method called to check build system integrity at build time.
* Returns 1 if CMake should rerun and 0 otherwise.
*/
int CheckBuildSystem();
void SetDirectoriesFromFile(const char* arg);
//! Make sure all commands are what they say they are and there is no
2012-04-19 19:04:21 +03:00
/// macros.
void CleanupCommandsAndMacros();
void GenerateGraphViz(const char* fileName) const;
cmVariableWatch* VariableWatch;
2011-01-16 11:35:12 +01:00
private:
ProgressCallbackType ProgressCallback;
void* ProgressCallbackClientData;
bool InTryCompile;
2012-02-18 12:40:36 +02:00
WorkingMode CurrentWorkingMode;
bool DebugOutput;
bool Trace;
2015-11-17 17:22:37 +01:00
bool TraceExpand;
2011-02-07 16:37:25 +01:00
bool WarnUninitialized;
bool WarnUnused;
bool WarnUnusedCli;
bool CheckSystemVars;
2015-04-27 22:25:09 +02:00
std::map<std::string, bool> UsedCliVariables;
std::string CMakeEditCommand;
std::string CXXEnvironment;
std::string CCEnvironment;
std::string CheckBuildSystemArgument;
std::string CheckStampFile;
std::string CheckStampList;
std::string VSSolutionFile;
2016-03-13 13:35:51 +01:00
std::vector<std::string> SourceFileExtensions;
2018-04-23 21:13:27 +02:00
std::unordered_set<std::string> SourceFileExtensionsSet;
2016-03-13 13:35:51 +01:00
std::vector<std::string> HeaderFileExtensions;
2018-04-23 21:13:27 +02:00
std::unordered_set<std::string> HeaderFileExtensionsSet;
bool ClearBuildSystem;
bool DebugTryCompile;
cmFileTimeComparison* FileComparison;
std::string GraphVizFile;
2015-04-27 22:25:09 +02:00
InstalledFilesMap InstalledFiles;
2011-01-16 11:35:12 +01:00
2015-08-17 11:37:30 +02:00
cmState* State;
2017-04-14 19:02:05 +02:00
cmStateSnapshot CurrentSnapshot;
2016-10-30 18:24:19 +01:00
cmMessenger* Messenger;
std::vector<std::string> TraceOnlyThisSources;
2015-08-17 11:37:30 +02:00
void UpdateConversionPathTable();
2015-08-17 11:37:30 +02:00
// Print a list of valid generators to stderr.
void PrintGeneratorList();
2017-04-14 19:02:05 +02:00
void CreateDefaultGlobalGenerator();
2016-03-13 13:35:51 +01:00
/**
* Convert a message type between a warning and an error, based on the state
* of the error output CMake variables, in the cache.
*/
2016-10-30 18:24:19 +01:00
cmake::MessageType ConvertMessageType(cmake::MessageType t) const;
2016-03-13 13:35:51 +01:00
/*
* Check if messages of this type should be output, based on the state of the
* warning and error output CMake variables, in the cache.
*/
2016-10-30 18:24:19 +01:00
bool IsMessageTypeVisible(cmake::MessageType t) const;
};
2016-07-09 11:21:54 +02:00
#define CMAKE_STANDARD_OPTIONS_TABLE \
{ "-C <initial-cache>", "Pre-load a script to populate the cache." }, \
2018-08-09 18:06:22 +02:00
{ "-D <var>[:<type>]=<value>", "Create or update a cmake cache entry." }, \
2016-07-09 11:21:54 +02:00
{ "-U <globbing_expr>", "Remove matching entries from CMake cache." }, \
{ "-G <generator-name>", "Specify a build system generator." }, \
{ "-T <toolset-name>", \
"Specify toolset name if supported by generator." }, \
{ "-A <platform-name>", \
"Specify platform name if supported by generator." }, \
{ "-Wdev", "Enable developer warnings." }, \
{ "-Wno-dev", "Suppress developer warnings." }, \
{ "-Werror=dev", "Make developer warnings errors." }, \
{ "-Wno-error=dev", "Make developer warnings not errors." }, \
{ "-Wdeprecated", "Enable deprecation warnings." }, \
{ "-Wno-deprecated", "Suppress deprecation warnings." }, \
2018-08-09 18:06:22 +02:00
{ "-Werror=deprecated", \
"Make deprecated macro and function warnings " \
"errors." }, \
2016-07-09 11:21:54 +02:00
{ \
2018-08-09 18:06:22 +02:00
"-Wno-error=deprecated", \
"Make deprecated macro and function warnings " \
"not errors." \
2016-07-09 11:21:54 +02:00
}
#define FOR_EACH_C_FEATURE(F) \
2017-04-14 19:02:05 +02:00
F(c_std_90) \
F(c_std_99) \
F(c_std_11) \
2016-07-09 11:21:54 +02:00
F(c_function_prototypes) \
F(c_restrict) \
F(c_static_assert) \
2015-04-27 22:25:09 +02:00
F(c_variadic_macros)
2016-07-09 11:21:54 +02:00
#define FOR_EACH_CXX_FEATURE(F) \
2017-04-14 19:02:05 +02:00
F(cxx_std_98) \
F(cxx_std_11) \
F(cxx_std_14) \
F(cxx_std_17) \
2018-08-09 18:06:22 +02:00
F(cxx_std_20) \
2016-07-09 11:21:54 +02:00
F(cxx_aggregate_default_initializers) \
F(cxx_alias_templates) \
F(cxx_alignas) \
F(cxx_alignof) \
F(cxx_attributes) \
F(cxx_attribute_deprecated) \
F(cxx_auto_type) \
F(cxx_binary_literals) \
F(cxx_constexpr) \
F(cxx_contextual_conversions) \
F(cxx_decltype) \
F(cxx_decltype_auto) \
F(cxx_decltype_incomplete_return_types) \
F(cxx_default_function_template_args) \
F(cxx_defaulted_functions) \
F(cxx_defaulted_move_initializers) \
F(cxx_delegating_constructors) \
F(cxx_deleted_functions) \
F(cxx_digit_separators) \
F(cxx_enum_forward_declarations) \
F(cxx_explicit_conversions) \
F(cxx_extended_friend_declarations) \
F(cxx_extern_templates) \
F(cxx_final) \
F(cxx_func_identifier) \
F(cxx_generalized_initializers) \
F(cxx_generic_lambdas) \
F(cxx_inheriting_constructors) \
F(cxx_inline_namespaces) \
F(cxx_lambdas) \
F(cxx_lambda_init_captures) \
F(cxx_local_type_template_args) \
F(cxx_long_long_type) \
F(cxx_noexcept) \
F(cxx_nonstatic_member_init) \
F(cxx_nullptr) \
F(cxx_override) \
F(cxx_range_for) \
F(cxx_raw_string_literals) \
F(cxx_reference_qualified_functions) \
F(cxx_relaxed_constexpr) \
F(cxx_return_type_deduction) \
F(cxx_right_angle_brackets) \
F(cxx_rvalue_references) \
F(cxx_sizeof_member) \
F(cxx_static_assert) \
F(cxx_strong_enums) \
F(cxx_template_template_parameters) \
F(cxx_thread_local) \
F(cxx_trailing_return_types) \
F(cxx_unicode_literals) \
F(cxx_uniform_initialization) \
F(cxx_unrestricted_unions) \
F(cxx_user_literals) \
F(cxx_variable_templates) \
F(cxx_variadic_macros) \
2015-04-27 22:25:09 +02:00
F(cxx_variadic_templates)
#endif