cmGlobalGenerator.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  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 cmGlobalGenerator_h
  4. #define cmGlobalGenerator_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <iosfwd>
  7. #include <map>
  8. #include <set>
  9. #include <string>
  10. #include <unordered_map>
  11. #include <utility>
  12. #include <vector>
  13. #include "cmCustomCommandLines.h"
  14. #include "cmDuration.h"
  15. #include "cmExportSetMap.h"
  16. #include "cmStateSnapshot.h"
  17. #include "cmSystemTools.h"
  18. #include "cmTarget.h"
  19. #include "cmTargetDepend.h"
  20. #include "cm_codecvt.hxx"
  21. #if defined(CMAKE_BUILD_WITH_CMAKE)
  22. #include "cmFileLockPool.h"
  23. #endif
  24. class cmExportBuildFileGenerator;
  25. class cmExternalMakefileProjectGenerator;
  26. class cmGeneratorTarget;
  27. class cmLinkLineComputer;
  28. class cmLocalGenerator;
  29. class cmMakefile;
  30. class cmOutputConverter;
  31. class cmQtAutoGenInitializer;
  32. class cmSourceFile;
  33. class cmStateDirectory;
  34. class cmake;
  35. /** \class cmGlobalGenerator
  36. * \brief Responsible for overseeing the generation process for the entire tree
  37. *
  38. * Subclasses of this class generate makefiles for various
  39. * platforms.
  40. */
  41. class cmGlobalGenerator
  42. {
  43. public:
  44. ///! Free any memory allocated with the GlobalGenerator
  45. cmGlobalGenerator(cmake* cm);
  46. virtual ~cmGlobalGenerator();
  47. virtual cmLocalGenerator* CreateLocalGenerator(cmMakefile* mf);
  48. ///! Get the name for this generator
  49. virtual std::string GetName() const { return "Generic"; }
  50. /** Check whether the given name matches the current generator. */
  51. virtual bool MatchesGeneratorName(const std::string& name) const
  52. {
  53. return this->GetName() == name;
  54. }
  55. /** Get encoding used by generator for makefile files */
  56. virtual codecvt::Encoding GetMakefileEncoding() const
  57. {
  58. return codecvt::None;
  59. }
  60. /** Tell the generator about the target system. */
  61. virtual bool SetSystemName(std::string const&, cmMakefile*) { return true; }
  62. /** Set the generator-specific instance. Returns true if supported. */
  63. virtual bool SetGeneratorInstance(std::string const& i, cmMakefile* mf);
  64. /** Set the generator-specific platform name. Returns true if platform
  65. is supported and false otherwise. */
  66. virtual bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf);
  67. /** Set the generator-specific toolset name. Returns true if toolset
  68. is supported and false otherwise. */
  69. virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf);
  70. /**
  71. * Create LocalGenerators and process the CMakeLists files. This does not
  72. * actually produce any makefiles, DSPs, etc.
  73. */
  74. virtual void Configure();
  75. bool Compute();
  76. virtual void AddExtraIDETargets() {}
  77. enum TargetTypes
  78. {
  79. AllTargets,
  80. ImportedOnly
  81. };
  82. void CreateImportedGenerationObjects(
  83. cmMakefile* mf, std::vector<std::string> const& targets,
  84. std::vector<cmGeneratorTarget const*>& exports);
  85. void CreateGenerationObjects(TargetTypes targetTypes = AllTargets);
  86. /**
  87. * Generate the all required files for building this project/tree. This
  88. * basically creates a series of LocalGenerators for each directory and
  89. * requests that they Generate.
  90. */
  91. virtual void Generate();
  92. virtual cmLinkLineComputer* CreateLinkLineComputer(
  93. cmOutputConverter* outputConverter,
  94. cmStateDirectory const& stateDir) const;
  95. cmLinkLineComputer* CreateMSVC60LinkLineComputer(
  96. cmOutputConverter* outputConverter,
  97. cmStateDirectory const& stateDir) const;
  98. /**
  99. * Set/Get and Clear the enabled languages.
  100. */
  101. void SetLanguageEnabled(const std::string&, cmMakefile* mf);
  102. bool GetLanguageEnabled(const std::string&) const;
  103. void ClearEnabledLanguages();
  104. void GetEnabledLanguages(std::vector<std::string>& lang) const;
  105. /**
  106. * Try to determine system information such as shared library
  107. * extension, pthreads, byte order etc.
  108. */
  109. virtual void EnableLanguage(std::vector<std::string> const& languages,
  110. cmMakefile*, bool optional);
  111. /**
  112. * Resolve the CMAKE_<lang>_COMPILER setting for the given language.
  113. * Intended to be called from EnableLanguage.
  114. */
  115. void ResolveLanguageCompiler(const std::string& lang, cmMakefile* mf,
  116. bool optional) const;
  117. /**
  118. * Try to determine system information, get it from another generator
  119. */
  120. void EnableLanguagesFromGenerator(cmGlobalGenerator* gen, cmMakefile* mf);
  121. /**
  122. * Try running cmake and building a file. This is used for dynamically
  123. * loaded commands, not as part of the usual build process.
  124. */
  125. int TryCompile(const std::string& srcdir, const std::string& bindir,
  126. const std::string& projectName, const std::string& targetName,
  127. bool fast, std::string& output, cmMakefile* mf);
  128. /**
  129. * Build a file given the following information. This is a more direct call
  130. * that is used by both CTest and TryCompile. If target name is NULL or
  131. * empty then all is assumed. clean indicates if a "make clean" should be
  132. * done first.
  133. */
  134. int Build(const std::string& srcdir, const std::string& bindir,
  135. const std::string& projectName, const std::string& targetName,
  136. std::string& output, const std::string& makeProgram,
  137. const std::string& config, bool clean, bool fast, bool verbose,
  138. cmDuration timeout, cmSystemTools::OutputOption outputflag =
  139. cmSystemTools::OUTPUT_NONE,
  140. std::vector<std::string> const& nativeOptions =
  141. std::vector<std::string>());
  142. /**
  143. * Open a generated IDE project given the following information.
  144. */
  145. virtual bool Open(const std::string& bindir, const std::string& projectName,
  146. bool dryRun);
  147. virtual void GenerateBuildCommand(
  148. std::vector<std::string>& makeCommand, const std::string& makeProgram,
  149. const std::string& projectName, const std::string& projectDir,
  150. const std::string& targetName, const std::string& config, bool fast,
  151. bool verbose,
  152. std::vector<std::string> const& makeOptions = std::vector<std::string>());
  153. /** Generate a "cmake --build" call for a given target and config. */
  154. std::string GenerateCMakeBuildCommand(const std::string& target,
  155. const std::string& config,
  156. const std::string& native,
  157. bool ignoreErrors);
  158. ///! Get the CMake instance
  159. cmake* GetCMakeInstance() const { return this->CMakeInstance; }
  160. void SetConfiguredFilesPath(cmGlobalGenerator* gen);
  161. const std::vector<cmMakefile*>& GetMakefiles() const
  162. {
  163. return this->Makefiles;
  164. }
  165. const std::vector<cmLocalGenerator*>& GetLocalGenerators() const
  166. {
  167. return this->LocalGenerators;
  168. }
  169. cmMakefile* GetCurrentMakefile() const
  170. {
  171. return this->CurrentConfigureMakefile;
  172. }
  173. void SetCurrentMakefile(cmMakefile* mf)
  174. {
  175. this->CurrentConfigureMakefile = mf;
  176. }
  177. void AddMakefile(cmMakefile* mf);
  178. ///! Set an generator for an "external makefile based project"
  179. void SetExternalMakefileProjectGenerator(
  180. cmExternalMakefileProjectGenerator* extraGenerator);
  181. std::string GetExtraGeneratorName() const;
  182. void AddInstallComponent(const char* component);
  183. const std::set<std::string>* GetInstallComponents() const
  184. {
  185. return &this->InstallComponents;
  186. }
  187. cmExportSetMap& GetExportSets() { return this->ExportSets; }
  188. const char* GetGlobalSetting(std::string const& name) const;
  189. bool GlobalSettingIsOn(std::string const& name) const;
  190. const char* GetSafeGlobalSetting(std::string const& name) const;
  191. /** Add a file to the manifest of generated targets for a configuration. */
  192. void AddToManifest(std::string const& f);
  193. void EnableInstallTarget();
  194. cmDuration TryCompileTimeout;
  195. bool GetForceUnixPaths() const { return this->ForceUnixPaths; }
  196. bool GetToolSupportsColor() const { return this->ToolSupportsColor; }
  197. ///! return the language for the given extension
  198. std::string GetLanguageFromExtension(const char* ext) const;
  199. ///! is an extension to be ignored
  200. bool IgnoreFile(const char* ext) const;
  201. ///! What is the preference for linkers and this language (None or Preferred)
  202. int GetLinkerPreference(const std::string& lang) const;
  203. ///! What is the object file extension for a given source file?
  204. std::string GetLanguageOutputExtension(cmSourceFile const&) const;
  205. ///! What is the configurations directory variable called?
  206. virtual const char* GetCMakeCFGIntDir() const { return "."; }
  207. ///! expand CFGIntDir for a configuration
  208. virtual std::string ExpandCFGIntDir(const std::string& str,
  209. const std::string& config) const;
  210. /** Get whether the generator should use a script for link commands. */
  211. bool GetUseLinkScript() const { return this->UseLinkScript; }
  212. /** Get whether the generator should produce special marks on rules
  213. producing symbolic (non-file) outputs. */
  214. bool GetNeedSymbolicMark() const { return this->NeedSymbolicMark; }
  215. /*
  216. * Determine what program to use for building the project.
  217. */
  218. virtual bool FindMakeProgram(cmMakefile*);
  219. ///! Find a target by name by searching the local generators.
  220. cmTarget* FindTarget(const std::string& name,
  221. bool excludeAliases = false) const;
  222. cmGeneratorTarget* FindGeneratorTarget(const std::string& name) const;
  223. void AddAlias(const std::string& name, const std::string& tgtName);
  224. bool IsAlias(const std::string& name) const;
  225. /** Determine if a name resolves to a framework on disk or a built target
  226. that is a framework. */
  227. bool NameResolvesToFramework(const std::string& libname) const;
  228. cmMakefile* FindMakefile(const std::string& start_dir) const;
  229. ///! Find a local generator by its startdirectory
  230. cmLocalGenerator* FindLocalGenerator(const std::string& start_dir) const;
  231. /** Append the subdirectory for the given configuration. If anything is
  232. appended the given prefix and suffix will be appended around it, which
  233. is useful for leading or trailing slashes. */
  234. virtual void AppendDirectoryForConfig(const std::string& prefix,
  235. const std::string& config,
  236. const std::string& suffix,
  237. std::string& dir);
  238. /** Get the content of a directory. Directory listings are cached
  239. and re-loaded from disk only when modified. During the generation
  240. step the content will include the target files to be built even if
  241. they do not yet exist. */
  242. std::set<std::string> const& GetDirectoryContent(std::string const& dir,
  243. bool needDisk = true);
  244. void IndexTarget(cmTarget* t);
  245. void IndexGeneratorTarget(cmGeneratorTarget* gt);
  246. static bool IsReservedTarget(std::string const& name);
  247. virtual const char* GetAllTargetName() const { return "ALL_BUILD"; }
  248. virtual const char* GetInstallTargetName() const { return "INSTALL"; }
  249. virtual const char* GetInstallLocalTargetName() const { return nullptr; }
  250. virtual const char* GetInstallStripTargetName() const { return nullptr; }
  251. virtual const char* GetPreinstallTargetName() const { return nullptr; }
  252. virtual const char* GetTestTargetName() const { return "RUN_TESTS"; }
  253. virtual const char* GetPackageTargetName() const { return "PACKAGE"; }
  254. virtual const char* GetPackageSourceTargetName() const { return nullptr; }
  255. virtual const char* GetEditCacheTargetName() const { return nullptr; }
  256. virtual const char* GetRebuildCacheTargetName() const { return nullptr; }
  257. virtual const char* GetCleanTargetName() const { return nullptr; }
  258. // Lookup edit_cache target command preferred by this generator.
  259. virtual std::string GetEditCacheCommand() const { return ""; }
  260. // Class to track a set of dependencies.
  261. typedef cmTargetDependSet TargetDependSet;
  262. // what targets does the specified target depend on directly
  263. // via a target_link_libraries or add_dependencies
  264. TargetDependSet const& GetTargetDirectDepends(
  265. const cmGeneratorTarget* target);
  266. const std::map<std::string, std::vector<cmLocalGenerator*>>& GetProjectMap()
  267. const
  268. {
  269. return this->ProjectMap;
  270. }
  271. // track files replaced during a Generate
  272. void FileReplacedDuringGenerate(const std::string& filename);
  273. void GetFilesReplacedDuringGenerate(std::vector<std::string>& filenames);
  274. void AddRuleHash(const std::vector<std::string>& outputs,
  275. std::string const& content);
  276. /** Return whether the given binary directory is unused. */
  277. bool BinaryDirectoryIsNew(const std::string& dir)
  278. {
  279. return this->BinaryDirectories.insert(dir).second;
  280. }
  281. /** Return true if the generated build tree may contain multiple builds.
  282. i.e. "Can I build Debug and Release in the same tree?" */
  283. virtual bool IsMultiConfig() const { return false; }
  284. /** Return true if we know the exact location of object files.
  285. If false, store the reason in the given string.
  286. This is meaningful only after EnableLanguage has been called. */
  287. virtual bool HasKnownObjectFileLocation(std::string*) const { return true; }
  288. virtual bool UseFolderProperty() const;
  289. virtual bool IsIPOSupported() const { return false; }
  290. /** Return whether the generator can import external visual studio project
  291. using INCLUDE_EXTERNAL_MSPROJECT */
  292. virtual bool IsIncludeExternalMSProjectSupported() const { return false; }
  293. /** Return whether the generator should use EFFECTIVE_PLATFORM_NAME. This is
  294. relevant for mixed macOS and iOS builds. */
  295. virtual bool UseEffectivePlatformName(cmMakefile*) const { return false; }
  296. /** Return whether the "Resources" folder prefix should be stripped from
  297. MacFolder. */
  298. virtual bool ShouldStripResourcePath(cmMakefile*) const;
  299. std::string GetSharedLibFlagsForLanguage(std::string const& lang) const;
  300. /** Generate an <output>.rule file path for a given command output. */
  301. virtual std::string GenerateRuleFile(std::string const& output) const;
  302. static std::string EscapeJSON(const std::string& s);
  303. void ProcessEvaluationFiles();
  304. std::map<std::string, cmExportBuildFileGenerator*>& GetBuildExportSets()
  305. {
  306. return this->BuildExportSets;
  307. }
  308. void AddBuildExportSet(cmExportBuildFileGenerator*);
  309. void AddBuildExportExportSet(cmExportBuildFileGenerator*);
  310. bool IsExportedTargetsFile(const std::string& filename) const;
  311. bool GenerateImportFile(const std::string& file);
  312. cmExportBuildFileGenerator* GetExportedTargetsFile(
  313. const std::string& filename) const;
  314. void AddCMP0042WarnTarget(const std::string& target);
  315. void AddCMP0068WarnTarget(const std::string& target);
  316. virtual void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const;
  317. bool GenerateCPackPropertiesFile();
  318. void CreateEvaluationSourceFiles(std::string const& config) const;
  319. void SetFilenameTargetDepends(
  320. cmSourceFile* sf, std::set<cmGeneratorTarget const*> const& tgts);
  321. const std::set<const cmGeneratorTarget*>& GetFilenameTargetDepends(
  322. cmSourceFile* sf) const;
  323. #if defined(CMAKE_BUILD_WITH_CMAKE)
  324. cmFileLockPool& GetFileLockPool() { return FileLockPool; }
  325. #endif
  326. bool GetConfigureDoneCMP0026() const
  327. {
  328. return this->ConfigureDoneCMP0026AndCMP0024;
  329. }
  330. std::string MakeSilentFlag;
  331. protected:
  332. typedef std::vector<cmLocalGenerator*> GeneratorVector;
  333. // for a project collect all its targets by following depend
  334. // information, and also collect all the targets
  335. void GetTargetSets(TargetDependSet& projectTargets,
  336. TargetDependSet& originalTargets, cmLocalGenerator* root,
  337. GeneratorVector const&);
  338. bool IsRootOnlyTarget(cmGeneratorTarget* target) const;
  339. void AddTargetDepends(const cmGeneratorTarget* target,
  340. TargetDependSet& projectTargets);
  341. void SetLanguageEnabledFlag(const std::string& l, cmMakefile* mf);
  342. void SetLanguageEnabledMaps(const std::string& l, cmMakefile* mf);
  343. void FillExtensionToLanguageMap(const std::string& l, cmMakefile* mf);
  344. virtual bool CheckLanguages(std::vector<std::string> const& languages,
  345. cmMakefile* mf) const;
  346. virtual void PrintCompilerAdvice(std::ostream& os, std::string const& lang,
  347. const char* envVar) const;
  348. virtual bool ComputeTargetDepends();
  349. virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const;
  350. // Qt auto generators
  351. std::vector<std::unique_ptr<cmQtAutoGenInitializer>>
  352. CreateQtAutoGenInitializers();
  353. std::string SelectMakeProgram(const std::string& makeProgram,
  354. const std::string& makeDefault = "") const;
  355. // Fill the ProjectMap, this must be called after LocalGenerators
  356. // has been populated.
  357. void FillProjectMap();
  358. void CheckTargetProperties();
  359. bool IsExcluded(cmStateSnapshot const& root,
  360. cmStateSnapshot const& snp) const;
  361. bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen) const;
  362. bool IsExcluded(cmLocalGenerator* root, cmGeneratorTarget* target) const;
  363. virtual void InitializeProgressMarks() {}
  364. struct GlobalTargetInfo
  365. {
  366. std::string Name;
  367. std::string Message;
  368. cmCustomCommandLines CommandLines;
  369. std::vector<std::string> Depends;
  370. std::string WorkingDir;
  371. bool UsesTerminal;
  372. GlobalTargetInfo()
  373. : UsesTerminal(false)
  374. {
  375. }
  376. };
  377. void CreateDefaultGlobalTargets(std::vector<GlobalTargetInfo>& targets);
  378. void AddGlobalTarget_Package(std::vector<GlobalTargetInfo>& targets);
  379. void AddGlobalTarget_PackageSource(std::vector<GlobalTargetInfo>& targets);
  380. void AddGlobalTarget_Test(std::vector<GlobalTargetInfo>& targets);
  381. void AddGlobalTarget_EditCache(std::vector<GlobalTargetInfo>& targets);
  382. void AddGlobalTarget_RebuildCache(std::vector<GlobalTargetInfo>& targets);
  383. void AddGlobalTarget_Install(std::vector<GlobalTargetInfo>& targets);
  384. cmTarget CreateGlobalTarget(GlobalTargetInfo const& gti, cmMakefile* mf);
  385. std::string FindMakeProgramFile;
  386. std::string ConfiguredFilesPath;
  387. cmake* CMakeInstance;
  388. std::vector<cmMakefile*> Makefiles;
  389. std::vector<cmLocalGenerator*> LocalGenerators;
  390. cmMakefile* CurrentConfigureMakefile;
  391. // map from project name to vector of local generators in that project
  392. std::map<std::string, std::vector<cmLocalGenerator*>> ProjectMap;
  393. // Set of named installation components requested by the project.
  394. std::set<std::string> InstallComponents;
  395. // Sets of named target exports
  396. cmExportSetMap ExportSets;
  397. std::map<std::string, cmExportBuildFileGenerator*> BuildExportSets;
  398. std::map<std::string, cmExportBuildFileGenerator*> BuildExportExportSets;
  399. std::map<std::string, std::string> AliasTargets;
  400. cmTarget* FindTargetImpl(std::string const& name) const;
  401. cmGeneratorTarget* FindGeneratorTargetImpl(std::string const& name) const;
  402. cmGeneratorTarget* FindImportedGeneratorTargetImpl(
  403. std::string const& name) const;
  404. const char* GetPredefinedTargetsFolder();
  405. private:
  406. typedef std::unordered_map<std::string, cmTarget*> TargetMap;
  407. typedef std::unordered_map<std::string, cmGeneratorTarget*>
  408. GeneratorTargetMap;
  409. typedef std::unordered_map<std::string, cmMakefile*> MakefileMap;
  410. // Map efficiently from target name to cmTarget instance.
  411. // Do not use this structure for looping over all targets.
  412. // It contains both normal and globally visible imported targets.
  413. TargetMap TargetSearchIndex;
  414. GeneratorTargetMap GeneratorTargetSearchIndex;
  415. // Map efficiently from source directory path to cmMakefile instance.
  416. // Do not use this structure for looping over all directories.
  417. // It may not contain all of them (see note in IndexMakefile method).
  418. MakefileMap MakefileSearchIndex;
  419. cmMakefile* TryCompileOuterMakefile;
  420. // If you add a new map here, make sure it is copied
  421. // in EnableLanguagesFromGenerator
  422. std::map<std::string, bool> IgnoreExtensions;
  423. std::set<std::string> LanguagesReady; // Ready for try_compile
  424. std::set<std::string> LanguagesInProgress;
  425. std::map<std::string, std::string> OutputExtensions;
  426. std::map<std::string, std::string> LanguageToOutputExtension;
  427. std::map<std::string, std::string> ExtensionToLanguage;
  428. std::map<std::string, int> LanguageToLinkerPreference;
  429. std::map<std::string, std::string> LanguageToOriginalSharedLibFlags;
  430. // Record hashes for rules and outputs.
  431. struct RuleHash
  432. {
  433. char Data[32];
  434. };
  435. std::map<std::string, RuleHash> RuleHashes;
  436. void CheckRuleHashes();
  437. void CheckRuleHashes(std::string const& pfile, std::string const& home);
  438. void WriteRuleHashes(std::string const& pfile);
  439. void WriteSummary();
  440. void WriteSummary(cmGeneratorTarget* target);
  441. void FinalizeTargetCompileInfo();
  442. virtual void ForceLinkerLanguages();
  443. bool CheckTargetsForMissingSources() const;
  444. void CreateLocalGenerators();
  445. void CheckCompilerIdCompatibility(cmMakefile* mf,
  446. std::string const& lang) const;
  447. void ComputeBuildFileGenerators();
  448. cmExternalMakefileProjectGenerator* ExtraGenerator;
  449. // track files replaced during a Generate
  450. std::vector<std::string> FilesReplacedDuringGenerate;
  451. // Store computed inter-target dependencies.
  452. typedef std::map<cmGeneratorTarget const*, TargetDependSet> TargetDependMap;
  453. TargetDependMap TargetDependencies;
  454. friend class cmake;
  455. void CreateGeneratorTargets(
  456. TargetTypes targetTypes, cmMakefile* mf, cmLocalGenerator* lg,
  457. std::map<cmTarget*, cmGeneratorTarget*> const& importedMap);
  458. void CreateGeneratorTargets(TargetTypes targetTypes);
  459. void ClearGeneratorMembers();
  460. bool CheckCMP0037(std::string const& targetName,
  461. std::string const& reason) const;
  462. void IndexMakefile(cmMakefile* mf);
  463. virtual const char* GetBuildIgnoreErrorsFlag() const { return nullptr; }
  464. // Cache directory content and target files to be built.
  465. struct DirectoryContent
  466. {
  467. long LastDiskTime;
  468. std::set<std::string> All;
  469. std::set<std::string> Generated;
  470. DirectoryContent()
  471. : LastDiskTime(-1)
  472. {
  473. }
  474. };
  475. std::map<std::string, DirectoryContent> DirectoryContentMap;
  476. // Set of binary directories on disk.
  477. std::set<std::string> BinaryDirectories;
  478. // track targets to issue CMP0042 warning for.
  479. std::set<std::string> CMP0042WarnTargets;
  480. // track targets to issue CMP0068 warning for.
  481. std::set<std::string> CMP0068WarnTargets;
  482. mutable std::map<cmSourceFile*, std::set<cmGeneratorTarget const*>>
  483. FilenameTargetDepends;
  484. #if defined(CMAKE_BUILD_WITH_CMAKE)
  485. // Pool of file locks
  486. cmFileLockPool FileLockPool;
  487. #endif
  488. protected:
  489. float FirstTimeProgress;
  490. bool NeedSymbolicMark;
  491. bool UseLinkScript;
  492. bool ForceUnixPaths;
  493. bool ToolSupportsColor;
  494. bool InstallTargetEnabled;
  495. bool ConfigureDoneCMP0026AndCMP0024;
  496. };
  497. #endif