cmake.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmake_h
  4. #define cmake_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <functional>
  7. #include <map>
  8. #include <memory> // IWYU pragma: keep
  9. #include <set>
  10. #include <string>
  11. #include <unordered_set>
  12. #include <vector>
  13. #include "cmInstalledFile.h"
  14. #include "cmListFileCache.h"
  15. #include "cmMessageType.h"
  16. #include "cmState.h"
  17. #include "cmStateSnapshot.h"
  18. #include "cmStateTypes.h"
  19. #if defined(CMAKE_BUILD_WITH_CMAKE)
  20. # include "cm_jsoncpp_value.h"
  21. #endif
  22. class cmExternalMakefileProjectGeneratorFactory;
  23. class cmFileAPI;
  24. class cmFileTimeCache;
  25. class cmGlobalGenerator;
  26. class cmGlobalGeneratorFactory;
  27. class cmMakefile;
  28. class cmMessenger;
  29. class cmVariableWatch;
  30. struct cmDocumentationEntry;
  31. /** \brief Represents a cmake invocation.
  32. *
  33. * This class represents a cmake invocation. It is the top level class when
  34. * running cmake. Most cmake based GUIs should primarily create an instance
  35. * of this class and communicate with it.
  36. *
  37. * The basic process for a GUI is as follows:
  38. *
  39. * -# Create a cmake instance
  40. * -# Set the Home directories, generator, and cmake command. this
  41. * can be done using the Set methods or by using SetArgs and passing in
  42. * command line arguments.
  43. * -# Load the cache by calling LoadCache (duh)
  44. * -# if you are using command line arguments with -D or -C flags then
  45. * call SetCacheArgs (or if for some other reason you want to modify the
  46. * cache), do it now.
  47. * -# Finally call Configure
  48. * -# Let the user change values and go back to step 5
  49. * -# call Generate
  50. * If your GUI allows the user to change the home directories then
  51. * you must at a minimum redo steps 2 through 7.
  52. */
  53. class cmake
  54. {
  55. public:
  56. enum Role
  57. {
  58. RoleInternal, // no commands
  59. RoleScript, // script commands
  60. RoleProject // all commands
  61. };
  62. enum DiagLevel
  63. {
  64. DIAG_IGNORE,
  65. DIAG_WARN,
  66. DIAG_ERROR
  67. };
  68. /** \brief Describes the working modes of cmake */
  69. enum WorkingMode
  70. {
  71. NORMAL_MODE, ///< Cmake runs to create project files
  72. /** \brief Script mode (started by using -P).
  73. *
  74. * In script mode there is no generator and no cache. Also,
  75. * languages are not enabled, so add_executable and things do
  76. * nothing.
  77. */
  78. SCRIPT_MODE,
  79. /** \brief A pkg-config like mode
  80. *
  81. * In this mode cmake just searches for a package and prints the results to
  82. * stdout. This is similar to SCRIPT_MODE, but commands like add_library()
  83. * work too, since they may be used e.g. in exported target files. Started
  84. * via --find-package.
  85. */
  86. FIND_PACKAGE_MODE
  87. };
  88. /** \brief Define log level constants. */
  89. enum LogLevel
  90. {
  91. LOG_UNDEFINED,
  92. LOG_ERROR,
  93. LOG_WARNING,
  94. LOG_NOTICE,
  95. LOG_STATUS,
  96. LOG_VERBOSE,
  97. LOG_DEBUG,
  98. LOG_TRACE
  99. };
  100. struct GeneratorInfo
  101. {
  102. std::string name;
  103. std::string baseName;
  104. std::string extraName;
  105. bool supportsToolset;
  106. bool supportsPlatform;
  107. std::vector<std::string> supportedPlatforms;
  108. std::string defaultPlatform;
  109. bool isAlias;
  110. };
  111. typedef std::map<std::string, cmInstalledFile> InstalledFilesMap;
  112. static const int NO_BUILD_PARALLEL_LEVEL = -1;
  113. static const int DEFAULT_BUILD_PARALLEL_LEVEL = 0;
  114. /// Default constructor
  115. cmake(Role role, cmState::Mode mode);
  116. /// Destructor
  117. ~cmake();
  118. cmake(cmake const&) = delete;
  119. cmake& operator=(cmake const&) = delete;
  120. #if defined(CMAKE_BUILD_WITH_CMAKE)
  121. Json::Value ReportVersionJson() const;
  122. Json::Value ReportCapabilitiesJson() const;
  123. #endif
  124. std::string ReportCapabilities() const;
  125. //@{
  126. /**
  127. * Set/Get the home directory (or output directory) in the project. The
  128. * home directory is the top directory of the project. It is the
  129. * path-to-source cmake was run with.
  130. */
  131. void SetHomeDirectory(const std::string& dir);
  132. std::string const& GetHomeDirectory() const;
  133. void SetHomeOutputDirectory(const std::string& dir);
  134. std::string const& GetHomeOutputDirectory() const;
  135. //@}
  136. /**
  137. * Handle a command line invocation of cmake.
  138. */
  139. int Run(const std::vector<std::string>& args)
  140. {
  141. return this->Run(args, false);
  142. }
  143. int Run(const std::vector<std::string>& args, bool noconfigure);
  144. /**
  145. * Run the global generator Generate step.
  146. */
  147. int Generate();
  148. /**
  149. * Configure the cmMakefiles. This routine will create a GlobalGenerator if
  150. * one has not already been set. It will then Call Configure on the
  151. * GlobalGenerator. This in turn will read in an process all the CMakeList
  152. * files for the tree. It will not produce any actual Makefiles, or
  153. * workspaces. Generate does that. */
  154. int Configure();
  155. int ActualConfigure();
  156. //! Break up a line like VAR:type="value" into var, type and value
  157. static bool ParseCacheEntry(const std::string& entry, std::string& var,
  158. std::string& value,
  159. cmStateEnums::CacheEntryType& type);
  160. int LoadCache();
  161. bool LoadCache(const std::string& path);
  162. bool LoadCache(const std::string& path, bool internal,
  163. std::set<std::string>& excludes,
  164. std::set<std::string>& includes);
  165. bool SaveCache(const std::string& path);
  166. bool DeleteCache(const std::string& path);
  167. void PreLoadCMakeFiles();
  168. //! Create a GlobalGenerator
  169. cmGlobalGenerator* CreateGlobalGenerator(const std::string& name);
  170. //! Return the global generator assigned to this instance of cmake
  171. cmGlobalGenerator* GetGlobalGenerator() { return this->GlobalGenerator; }
  172. //! Return the global generator assigned to this instance of cmake, const
  173. const cmGlobalGenerator* GetGlobalGenerator() const
  174. {
  175. return this->GlobalGenerator;
  176. }
  177. //! Return the full path to where the CMakeCache.txt file should be.
  178. static std::string FindCacheFile(const std::string& binaryDir);
  179. //! Return the global generator assigned to this instance of cmake
  180. void SetGlobalGenerator(cmGlobalGenerator*);
  181. //! Get the names of the current registered generators
  182. void GetRegisteredGenerators(std::vector<GeneratorInfo>& generators,
  183. bool includeNamesWithPlatform = true) const;
  184. //! Set the name of the selected generator-specific instance.
  185. void SetGeneratorInstance(std::string const& instance)
  186. {
  187. this->GeneratorInstance = instance;
  188. this->GeneratorInstanceSet = true;
  189. }
  190. //! Set the name of the selected generator-specific platform.
  191. void SetGeneratorPlatform(std::string const& ts)
  192. {
  193. this->GeneratorPlatform = ts;
  194. this->GeneratorPlatformSet = true;
  195. }
  196. //! Set the name of the selected generator-specific toolset.
  197. void SetGeneratorToolset(std::string const& ts)
  198. {
  199. this->GeneratorToolset = ts;
  200. this->GeneratorToolsetSet = true;
  201. }
  202. const std::vector<std::string>& GetSourceExtensions() const
  203. {
  204. return this->SourceFileExtensions;
  205. }
  206. bool IsSourceExtension(const std::string& ext) const
  207. {
  208. return this->SourceFileExtensionsSet.find(ext) !=
  209. this->SourceFileExtensionsSet.end();
  210. }
  211. const std::vector<std::string>& GetHeaderExtensions() const
  212. {
  213. return this->HeaderFileExtensions;
  214. }
  215. bool IsHeaderExtension(const std::string& ext) const
  216. {
  217. return this->HeaderFileExtensionsSet.find(ext) !=
  218. this->HeaderFileExtensionsSet.end();
  219. }
  220. // Strips the extension (if present and known) from a filename
  221. std::string StripExtension(const std::string& file) const;
  222. /**
  223. * Given a variable name, return its value (as a string).
  224. */
  225. const char* GetCacheDefinition(const std::string&) const;
  226. //! Add an entry into the cache
  227. void AddCacheEntry(const std::string& key, const char* value,
  228. const char* helpString, int type);
  229. bool DoWriteGlobVerifyTarget() const;
  230. std::string const& GetGlobVerifyScript() const;
  231. std::string const& GetGlobVerifyStamp() const;
  232. void AddGlobCacheEntry(bool recurse, bool listDirectories,
  233. bool followSymlinks, const std::string& relative,
  234. const std::string& expression,
  235. const std::vector<std::string>& files,
  236. const std::string& variable,
  237. cmListFileBacktrace const& bt);
  238. /**
  239. * Get the system information and write it to the file specified
  240. */
  241. int GetSystemInformation(std::vector<std::string>&);
  242. //! Parse environment variables
  243. void LoadEnvironmentPresets();
  244. //! Parse command line arguments
  245. void SetArgs(const std::vector<std::string>& args);
  246. //! Is this cmake running as a result of a TRY_COMPILE command
  247. bool GetIsInTryCompile() const;
  248. void SetIsInTryCompile(bool b);
  249. //! Parse command line arguments that might set cache values
  250. bool SetCacheArgs(const std::vector<std::string>&);
  251. using ProgressCallbackType = std::function<void(const std::string&, float)>;
  252. /**
  253. * Set the function used by GUIs to receive progress updates
  254. * Function gets passed: message as a const char*, a progress
  255. * amount ranging from 0 to 1.0 and client data. The progress
  256. * number provided may be negative in cases where a message is
  257. * to be displayed without any progress percentage.
  258. */
  259. void SetProgressCallback(ProgressCallbackType f);
  260. //! this is called by generators to update the progress
  261. void UpdateProgress(const std::string& msg, float prog);
  262. #if defined(CMAKE_BUILD_WITH_CMAKE)
  263. //! Get the variable watch object
  264. cmVariableWatch* GetVariableWatch() { return this->VariableWatch; }
  265. #endif
  266. std::vector<cmDocumentationEntry> GetGeneratorsDocumentation();
  267. //! Set/Get a property of this target file
  268. void SetProperty(const std::string& prop, const char* value);
  269. void AppendProperty(const std::string& prop, const char* value,
  270. bool asString = false);
  271. const char* GetProperty(const std::string& prop);
  272. bool GetPropertyAsBool(const std::string& prop);
  273. //! Get or create an cmInstalledFile instance and return a pointer to it
  274. cmInstalledFile* GetOrCreateInstalledFile(cmMakefile* mf,
  275. const std::string& name);
  276. cmInstalledFile const* GetInstalledFile(const std::string& name) const;
  277. InstalledFilesMap const& GetInstalledFiles() const
  278. {
  279. return this->InstalledFiles;
  280. }
  281. //! Do all the checks before running configure
  282. int DoPreConfigureChecks();
  283. void SetWorkingMode(WorkingMode mode) { this->CurrentWorkingMode = mode; }
  284. WorkingMode GetWorkingMode() { return this->CurrentWorkingMode; }
  285. //! Debug the try compile stuff by not deleting the files
  286. bool GetDebugTryCompile() { return this->DebugTryCompile; }
  287. void DebugTryCompileOn() { this->DebugTryCompile = true; }
  288. /**
  289. * Generate CMAKE_ROOT and CMAKE_COMMAND cache entries
  290. */
  291. int AddCMakePaths();
  292. /**
  293. * Get the file comparison class
  294. */
  295. cmFileTimeCache* GetFileTimeCache() { return this->FileTimeCache; }
  296. // Get the selected log level for `message()` commands during the cmake run.
  297. LogLevel GetLogLevel() const { return this->MessageLogLevel; }
  298. void SetLogLevel(LogLevel level) { this->MessageLogLevel = level; }
  299. static LogLevel StringToLogLevel(const std::string& levelStr);
  300. // Do we want debug output during the cmake run.
  301. bool GetDebugOutput() { return this->DebugOutput; }
  302. void SetDebugOutputOn(bool b) { this->DebugOutput = b; }
  303. // Do we want trace output during the cmake run.
  304. bool GetTrace() { return this->Trace; }
  305. void SetTrace(bool b) { this->Trace = b; }
  306. bool GetTraceExpand() { return this->TraceExpand; }
  307. void SetTraceExpand(bool b) { this->TraceExpand = b; }
  308. void AddTraceSource(std::string const& file)
  309. {
  310. this->TraceOnlyThisSources.push_back(file);
  311. }
  312. std::vector<std::string> const& GetTraceSources() const
  313. {
  314. return this->TraceOnlyThisSources;
  315. }
  316. bool GetWarnUninitialized() { return this->WarnUninitialized; }
  317. void SetWarnUninitialized(bool b) { this->WarnUninitialized = b; }
  318. bool GetWarnUnused() { return this->WarnUnused; }
  319. void SetWarnUnused(bool b) { this->WarnUnused = b; }
  320. bool GetWarnUnusedCli() { return this->WarnUnusedCli; }
  321. void SetWarnUnusedCli(bool b) { this->WarnUnusedCli = b; }
  322. bool GetCheckSystemVars() { return this->CheckSystemVars; }
  323. void SetCheckSystemVars(bool b) { this->CheckSystemVars = b; }
  324. void MarkCliAsUsed(const std::string& variable);
  325. /** Get the list of configurations (in upper case) considered to be
  326. debugging configurations.*/
  327. std::vector<std::string> GetDebugConfigs();
  328. void SetCMakeEditCommand(std::string const& s)
  329. {
  330. this->CMakeEditCommand = s;
  331. }
  332. std::string const& GetCMakeEditCommand() const
  333. {
  334. return this->CMakeEditCommand;
  335. }
  336. cmMessenger* GetMessenger() const;
  337. /*
  338. * Get the state of the suppression of developer (author) warnings.
  339. * Returns false, by default, if developer warnings should be shown, true
  340. * otherwise.
  341. */
  342. bool GetSuppressDevWarnings() const;
  343. /*
  344. * Set the state of the suppression of developer (author) warnings.
  345. */
  346. void SetSuppressDevWarnings(bool v);
  347. /*
  348. * Get the state of the suppression of deprecated warnings.
  349. * Returns false, by default, if deprecated warnings should be shown, true
  350. * otherwise.
  351. */
  352. bool GetSuppressDeprecatedWarnings() const;
  353. /*
  354. * Set the state of the suppression of deprecated warnings.
  355. */
  356. void SetSuppressDeprecatedWarnings(bool v);
  357. /*
  358. * Get the state of treating developer (author) warnings as errors.
  359. * Returns false, by default, if warnings should not be treated as errors,
  360. * true otherwise.
  361. */
  362. bool GetDevWarningsAsErrors() const;
  363. /**
  364. * Set the state of treating developer (author) warnings as errors.
  365. */
  366. void SetDevWarningsAsErrors(bool v);
  367. /*
  368. * Get the state of treating deprecated warnings as errors.
  369. * Returns false, by default, if warnings should not be treated as errors,
  370. * true otherwise.
  371. */
  372. bool GetDeprecatedWarningsAsErrors() const;
  373. /**
  374. * Set the state of treating developer (author) warnings as errors.
  375. */
  376. void SetDeprecatedWarningsAsErrors(bool v);
  377. /** Display a message to the user. */
  378. void IssueMessage(
  379. MessageType t, std::string const& text,
  380. cmListFileBacktrace const& backtrace = cmListFileBacktrace()) const;
  381. //! run the --build option
  382. int Build(int jobs, const std::string& dir,
  383. const std::vector<std::string>& targets, const std::string& config,
  384. const std::vector<std::string>& nativeOptions, bool clean,
  385. bool verbose);
  386. //! run the --open option
  387. bool Open(const std::string& dir, bool dryRun);
  388. void UnwatchUnusedCli(const std::string& var);
  389. void WatchUnusedCli(const std::string& var);
  390. cmState* GetState() const { return this->State; }
  391. void SetCurrentSnapshot(cmStateSnapshot const& snapshot)
  392. {
  393. this->CurrentSnapshot = snapshot;
  394. }
  395. cmStateSnapshot GetCurrentSnapshot() const { return this->CurrentSnapshot; }
  396. protected:
  397. void RunCheckForUnusedVariables();
  398. int HandleDeleteCacheVariables(const std::string& var);
  399. typedef std::vector<cmGlobalGeneratorFactory*> RegisteredGeneratorsVector;
  400. RegisteredGeneratorsVector Generators;
  401. typedef std::vector<cmExternalMakefileProjectGeneratorFactory*>
  402. RegisteredExtraGeneratorsVector;
  403. RegisteredExtraGeneratorsVector ExtraGenerators;
  404. void AddScriptingCommands();
  405. void AddProjectCommands();
  406. void AddDefaultGenerators();
  407. void AddDefaultExtraGenerators();
  408. cmGlobalGenerator* GlobalGenerator;
  409. std::map<std::string, DiagLevel> DiagLevels;
  410. std::string GeneratorInstance;
  411. std::string GeneratorPlatform;
  412. std::string GeneratorToolset;
  413. bool GeneratorInstanceSet;
  414. bool GeneratorPlatformSet;
  415. bool GeneratorToolsetSet;
  416. //! read in a cmake list file to initialize the cache
  417. void ReadListFile(const std::vector<std::string>& args,
  418. const std::string& path);
  419. bool FindPackage(const std::vector<std::string>& args);
  420. //! Check if CMAKE_CACHEFILE_DIR is set. If it is not, delete the log file.
  421. /// If it is set, truncate it to 50kb
  422. void TruncateOutputLog(const char* fname);
  423. /**
  424. * Method called to check build system integrity at build time.
  425. * Returns 1 if CMake should rerun and 0 otherwise.
  426. */
  427. int CheckBuildSystem();
  428. void SetDirectoriesFromFile(const std::string& arg);
  429. //! Make sure all commands are what they say they are and there is no
  430. /// macros.
  431. void CleanupCommandsAndMacros();
  432. void GenerateGraphViz(const std::string& fileName) const;
  433. private:
  434. ProgressCallbackType ProgressCallback;
  435. WorkingMode CurrentWorkingMode;
  436. bool DebugOutput;
  437. bool Trace;
  438. bool TraceExpand;
  439. bool WarnUninitialized;
  440. bool WarnUnused;
  441. bool WarnUnusedCli;
  442. bool CheckSystemVars;
  443. std::map<std::string, bool> UsedCliVariables;
  444. std::string CMakeEditCommand;
  445. std::string CXXEnvironment;
  446. std::string CCEnvironment;
  447. std::string CheckBuildSystemArgument;
  448. std::string CheckStampFile;
  449. std::string CheckStampList;
  450. std::string VSSolutionFile;
  451. std::string EnvironmentGenerator;
  452. std::vector<std::string> SourceFileExtensions;
  453. std::unordered_set<std::string> SourceFileExtensionsSet;
  454. std::vector<std::string> HeaderFileExtensions;
  455. std::unordered_set<std::string> HeaderFileExtensionsSet;
  456. bool ClearBuildSystem;
  457. bool DebugTryCompile;
  458. cmFileTimeCache* FileTimeCache;
  459. std::string GraphVizFile;
  460. InstalledFilesMap InstalledFiles;
  461. #if defined(CMAKE_BUILD_WITH_CMAKE)
  462. cmVariableWatch* VariableWatch;
  463. std::unique_ptr<cmFileAPI> FileAPI;
  464. #endif
  465. cmState* State;
  466. cmStateSnapshot CurrentSnapshot;
  467. cmMessenger* Messenger;
  468. std::vector<std::string> TraceOnlyThisSources;
  469. LogLevel MessageLogLevel = LogLevel::LOG_STATUS;
  470. void UpdateConversionPathTable();
  471. // Print a list of valid generators to stderr.
  472. void PrintGeneratorList();
  473. std::unique_ptr<cmGlobalGenerator> EvaluateDefaultGlobalGenerator();
  474. void CreateDefaultGlobalGenerator();
  475. void AppendGlobalGeneratorsDocumentation(std::vector<cmDocumentationEntry>&);
  476. void AppendExtraGeneratorsDocumentation(std::vector<cmDocumentationEntry>&);
  477. };
  478. #define CMAKE_STANDARD_OPTIONS_TABLE \
  479. { "-S <path-to-source>", "Explicitly specify a source directory." }, \
  480. { "-B <path-to-build>", "Explicitly specify a build directory." }, \
  481. { "-C <initial-cache>", "Pre-load a script to populate the cache." }, \
  482. { "-D <var>[:<type>]=<value>", "Create or update a cmake cache entry." }, \
  483. { "-U <globbing_expr>", "Remove matching entries from CMake cache." }, \
  484. { "-G <generator-name>", "Specify a build system generator." }, \
  485. { "-T <toolset-name>", \
  486. "Specify toolset name if supported by generator." }, \
  487. { "-A <platform-name>", \
  488. "Specify platform name if supported by generator." }, \
  489. { "-Wdev", "Enable developer warnings." }, \
  490. { "-Wno-dev", "Suppress developer warnings." }, \
  491. { "-Werror=dev", "Make developer warnings errors." }, \
  492. { "-Wno-error=dev", "Make developer warnings not errors." }, \
  493. { "-Wdeprecated", "Enable deprecation warnings." }, \
  494. { "-Wno-deprecated", "Suppress deprecation warnings." }, \
  495. { "-Werror=deprecated", \
  496. "Make deprecated macro and function warnings " \
  497. "errors." }, \
  498. { \
  499. "-Wno-error=deprecated", \
  500. "Make deprecated macro and function warnings " \
  501. "not errors." \
  502. }
  503. #define FOR_EACH_C90_FEATURE(F) F(c_function_prototypes)
  504. #define FOR_EACH_C99_FEATURE(F) \
  505. F(c_restrict) \
  506. F(c_variadic_macros)
  507. #define FOR_EACH_C11_FEATURE(F) F(c_static_assert)
  508. #define FOR_EACH_C_FEATURE(F) \
  509. F(c_std_90) \
  510. F(c_std_99) \
  511. F(c_std_11) \
  512. FOR_EACH_C90_FEATURE(F) \
  513. FOR_EACH_C99_FEATURE(F) \
  514. FOR_EACH_C11_FEATURE(F)
  515. #define FOR_EACH_CXX98_FEATURE(F) F(cxx_template_template_parameters)
  516. #define FOR_EACH_CXX11_FEATURE(F) \
  517. F(cxx_alias_templates) \
  518. F(cxx_alignas) \
  519. F(cxx_alignof) \
  520. F(cxx_attributes) \
  521. F(cxx_auto_type) \
  522. F(cxx_constexpr) \
  523. F(cxx_decltype) \
  524. F(cxx_decltype_incomplete_return_types) \
  525. F(cxx_default_function_template_args) \
  526. F(cxx_defaulted_functions) \
  527. F(cxx_defaulted_move_initializers) \
  528. F(cxx_delegating_constructors) \
  529. F(cxx_deleted_functions) \
  530. F(cxx_enum_forward_declarations) \
  531. F(cxx_explicit_conversions) \
  532. F(cxx_extended_friend_declarations) \
  533. F(cxx_extern_templates) \
  534. F(cxx_final) \
  535. F(cxx_func_identifier) \
  536. F(cxx_generalized_initializers) \
  537. F(cxx_inheriting_constructors) \
  538. F(cxx_inline_namespaces) \
  539. F(cxx_lambdas) \
  540. F(cxx_local_type_template_args) \
  541. F(cxx_long_long_type) \
  542. F(cxx_noexcept) \
  543. F(cxx_nonstatic_member_init) \
  544. F(cxx_nullptr) \
  545. F(cxx_override) \
  546. F(cxx_range_for) \
  547. F(cxx_raw_string_literals) \
  548. F(cxx_reference_qualified_functions) \
  549. F(cxx_right_angle_brackets) \
  550. F(cxx_rvalue_references) \
  551. F(cxx_sizeof_member) \
  552. F(cxx_static_assert) \
  553. F(cxx_strong_enums) \
  554. F(cxx_thread_local) \
  555. F(cxx_trailing_return_types) \
  556. F(cxx_unicode_literals) \
  557. F(cxx_uniform_initialization) \
  558. F(cxx_unrestricted_unions) \
  559. F(cxx_user_literals) \
  560. F(cxx_variadic_macros) \
  561. F(cxx_variadic_templates)
  562. #define FOR_EACH_CXX14_FEATURE(F) \
  563. F(cxx_aggregate_default_initializers) \
  564. F(cxx_attribute_deprecated) \
  565. F(cxx_binary_literals) \
  566. F(cxx_contextual_conversions) \
  567. F(cxx_decltype_auto) \
  568. F(cxx_digit_separators) \
  569. F(cxx_generic_lambdas) \
  570. F(cxx_lambda_init_captures) \
  571. F(cxx_relaxed_constexpr) \
  572. F(cxx_return_type_deduction) \
  573. F(cxx_variable_templates)
  574. #define FOR_EACH_CXX_FEATURE(F) \
  575. F(cxx_std_98) \
  576. F(cxx_std_11) \
  577. F(cxx_std_14) \
  578. F(cxx_std_17) \
  579. F(cxx_std_20) \
  580. FOR_EACH_CXX98_FEATURE(F) \
  581. FOR_EACH_CXX11_FEATURE(F) \
  582. FOR_EACH_CXX14_FEATURE(F)
  583. #endif