cmGeneratorTarget.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2012 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmGeneratorTarget_h
  11. #define cmGeneratorTarget_h
  12. #include "cmLinkItem.h"
  13. class cmCustomCommand;
  14. class cmGlobalGenerator;
  15. class cmLocalGenerator;
  16. class cmMakefile;
  17. class cmSourceFile;
  18. class cmTarget;
  19. class cmComputeLinkInformation;
  20. class cmGeneratorTarget
  21. {
  22. public:
  23. cmGeneratorTarget(cmTarget*, cmLocalGenerator* lg);
  24. ~cmGeneratorTarget();
  25. cmLocalGenerator* GetLocalGenerator() const;
  26. bool IsImported() const;
  27. const char *GetLocation(const std::string& config) const;
  28. #define DECLARE_TARGET_POLICY(POLICY) \
  29. cmPolicies::PolicyStatus GetPolicyStatus ## POLICY () const \
  30. { return this->PolicyMap.Get(cmPolicies::POLICY); }
  31. CM_FOR_EACH_TARGET_POLICY(DECLARE_TARGET_POLICY)
  32. #undef DECLARE_TARGET_POLICY
  33. /** Get the location of the target in the build tree with a placeholder
  34. referencing the configuration in the native build system. This
  35. location is suitable for use as the LOCATION target property. */
  36. const char* GetLocationForBuild() const;
  37. cmComputeLinkInformation*
  38. GetLinkInformation(const std::string& config) const;
  39. cmState::TargetType GetType() const;
  40. std::string GetName() const;
  41. std::string GetExportName() const;
  42. const char *GetProperty(const std::string& prop) const;
  43. bool GetPropertyAsBool(const std::string& prop) const;
  44. void GetSourceFiles(std::vector<cmSourceFile*>& files,
  45. const std::string& config) const;
  46. void GetObjectSources(std::vector<cmSourceFile const*> &,
  47. const std::string& config) const;
  48. const std::string& GetObjectName(cmSourceFile const* file);
  49. bool HasExplicitObjectName(cmSourceFile const* file) const;
  50. void AddExplicitObjectName(cmSourceFile const* sf);
  51. void GetResxSources(std::vector<cmSourceFile const*>&,
  52. const std::string& config) const;
  53. void GetIDLSources(std::vector<cmSourceFile const*>&,
  54. const std::string& config) const;
  55. void GetExternalObjects(std::vector<cmSourceFile const*>&,
  56. const std::string& config) const;
  57. void GetHeaderSources(std::vector<cmSourceFile const*>&,
  58. const std::string& config) const;
  59. void GetExtraSources(std::vector<cmSourceFile const*>&,
  60. const std::string& config) const;
  61. void GetCustomCommands(std::vector<cmSourceFile const*>&,
  62. const std::string& config) const;
  63. void GetExpectedResxHeaders(std::set<std::string>&,
  64. const std::string& config) const;
  65. void GetAppManifest(std::vector<cmSourceFile const*>&,
  66. const std::string& config) const;
  67. void GetManifests(std::vector<cmSourceFile const*>&,
  68. const std::string& config) const;
  69. void GetCertificates(std::vector<cmSourceFile const*>&,
  70. const std::string& config) const;
  71. void GetXamlSources(std::vector<cmSourceFile const*>&,
  72. const std::string& config) const;
  73. void GetExpectedXamlHeaders(std::set<std::string>&,
  74. const std::string& config) const;
  75. void GetExpectedXamlSources(std::set<std::string>&,
  76. const std::string& config) const;
  77. std::set<cmLinkItem>const& GetUtilityItems() const;
  78. void ComputeObjectMapping();
  79. const char* GetFeature(const std::string& feature,
  80. const std::string& config) const;
  81. bool GetFeatureAsBool(const std::string& feature,
  82. const std::string& config) const;
  83. bool IsLinkInterfaceDependentBoolProperty(const std::string &p,
  84. const std::string& config) const;
  85. bool IsLinkInterfaceDependentStringProperty(const std::string &p,
  86. const std::string& config) const;
  87. bool IsLinkInterfaceDependentNumberMinProperty(const std::string &p,
  88. const std::string& config) const;
  89. bool IsLinkInterfaceDependentNumberMaxProperty(const std::string &p,
  90. const std::string& config) const;
  91. bool GetLinkInterfaceDependentBoolProperty(const std::string &p,
  92. const std::string& config) const;
  93. const char *GetLinkInterfaceDependentStringProperty(const std::string &p,
  94. const std::string& config) const;
  95. const char *GetLinkInterfaceDependentNumberMinProperty(const std::string &p,
  96. const std::string& config) const;
  97. const char *GetLinkInterfaceDependentNumberMaxProperty(const std::string &p,
  98. const std::string& config) const;
  99. cmLinkInterface const* GetLinkInterface(const std::string& config,
  100. const cmGeneratorTarget* headTarget) const;
  101. void ComputeLinkInterface(const std::string& config,
  102. cmOptionalLinkInterface& iface,
  103. const cmGeneratorTarget* head) const;
  104. cmLinkInterfaceLibraries const*
  105. GetLinkInterfaceLibraries(const std::string& config,
  106. const cmGeneratorTarget* headTarget,
  107. bool usage_requirements_only) const;
  108. void ComputeLinkInterfaceLibraries(const std::string& config,
  109. cmOptionalLinkInterface &iface,
  110. const cmGeneratorTarget* head,
  111. bool usage_requirements_only) const;
  112. /** Get the full path to the target according to the settings in its
  113. makefile and the configuration type. */
  114. std::string GetFullPath(const std::string& config="", bool implib = false,
  115. bool realname = false) const;
  116. std::string NormalGetFullPath(const std::string& config, bool implib,
  117. bool realname) const;
  118. std::string NormalGetRealName(const std::string& config) const;
  119. /** @return the Mac App directory without the base */
  120. std::string GetAppBundleDirectory(const std::string& config,
  121. bool contentOnly) const;
  122. /** Return whether this target is an executable Bundle, a framework
  123. or CFBundle on Apple. */
  124. bool IsBundleOnApple() const;
  125. /** Get the full name of the target according to the settings in its
  126. makefile. */
  127. std::string GetFullName(const std::string& config="",
  128. bool implib = false) const;
  129. /** @return the Mac framework directory without the base. */
  130. std::string GetFrameworkDirectory(const std::string& config,
  131. bool rootDir) const;
  132. /** @return the Mac CFBundle directory without the base */
  133. std::string GetCFBundleDirectory(const std::string& config,
  134. bool contentOnly) const;
  135. /** Return the install name directory for the target in the
  136. * build tree. For example: "\@rpath/", "\@loader_path/",
  137. * or "/full/path/to/library". */
  138. std::string GetInstallNameDirForBuildTree(const std::string& config) const;
  139. /** Return the install name directory for the target in the
  140. * install tree. For example: "\@rpath/" or "\@loader_path/". */
  141. std::string GetInstallNameDirForInstallTree() const;
  142. cmListFileBacktrace GetBacktrace() const;
  143. /** Get the macro to define when building sources in this target.
  144. If no macro should be defined null is returned. */
  145. const char* GetExportMacro() const;
  146. /** Get the soname of the target. Allowed only for a shared library. */
  147. std::string GetSOName(const std::string& config) const;
  148. void GetFullNameComponents(std::string& prefix,
  149. std::string& base, std::string& suffix,
  150. const std::string& config="",
  151. bool implib = false) const;
  152. /** Append to @a base the mac content directory and return it. */
  153. std::string BuildMacContentDirectory(const std::string& base,
  154. const std::string& config = "",
  155. bool contentOnly = true) const;
  156. /** @return the mac content directory for this target. */
  157. std::string GetMacContentDirectory(const std::string& config = 0,
  158. bool implib = false) const;
  159. cmTarget* Target;
  160. cmMakefile* Makefile;
  161. cmLocalGenerator* LocalGenerator;
  162. cmGlobalGenerator const* GlobalGenerator;
  163. std::string GetModuleDefinitionFile(const std::string& config) const;
  164. /** Return whether or not the target is for a DLL platform. */
  165. bool IsDLLPlatform() const;
  166. /** @return whether this target have a well defined output file name. */
  167. bool HaveWellDefinedOutputFiles() const;
  168. /** Link information from the transitive closure of the link
  169. implementation and the interfaces of its dependencies. */
  170. struct LinkClosure
  171. {
  172. // The preferred linker language.
  173. std::string LinkerLanguage;
  174. // Languages whose runtime libraries must be linked.
  175. std::vector<std::string> Languages;
  176. };
  177. LinkClosure const* GetLinkClosure(const std::string& config) const;
  178. void ComputeLinkClosure(const std::string& config, LinkClosure& lc) const;
  179. cmLinkImplementation const*
  180. GetLinkImplementation(const std::string& config) const;
  181. void ComputeLinkImplementationLanguages(const std::string& config,
  182. cmOptionalLinkImplementation& impl
  183. ) const;
  184. cmLinkImplementationLibraries const*
  185. GetLinkImplementationLibraries(const std::string& config) const;
  186. void ComputeLinkImplementationLibraries(const std::string& config,
  187. cmOptionalLinkImplementation& impl,
  188. const cmGeneratorTarget* head) const;
  189. cmGeneratorTarget* FindTargetToLink(std::string const& name) const;
  190. // Compute the set of languages compiled by the target. This is
  191. // computed every time it is called because the languages can change
  192. // when source file properties are changed and we do not have enough
  193. // information to forward these property changes to the targets
  194. // until we have per-target object file properties.
  195. void GetLanguages(std::set<std::string>& languages,
  196. std::string const& config) const;
  197. void
  198. GetObjectLibrariesCMP0026(std::vector<cmGeneratorTarget*>& objlibs) const;
  199. std::string GetFullNameImported(const std::string& config,
  200. bool implib) const;
  201. bool GetConfigCommonSourceFiles(std::vector<cmSourceFile*>& files) const;
  202. bool HaveBuildTreeRPATH(const std::string& config) const;
  203. /** Full path with trailing slash to the top-level directory
  204. holding object files for this target. Includes the build
  205. time config name placeholder if needed for the generator. */
  206. std::string ObjectDirectory;
  207. void UseObjectLibraries(std::vector<std::string>& objs,
  208. const std::string& config) const;
  209. void GetAppleArchs(const std::string& config,
  210. std::vector<std::string>& archVec) const;
  211. /** Return the rule variable used to create this type of target. */
  212. std::string GetCreateRuleVariable(std::string const& lang,
  213. std::string const& config) const;
  214. /** Get the include directories for this target. */
  215. std::vector<std::string> GetIncludeDirectories(
  216. const std::string& config, const std::string& lang) const;
  217. void GetCompileOptions(std::vector<std::string> &result,
  218. const std::string& config,
  219. const std::string& language) const;
  220. void GetCompileFeatures(std::vector<std::string> &features,
  221. const std::string& config) const;
  222. void GetCompileDefinitions(std::vector<std::string> &result,
  223. const std::string& config,
  224. const std::string& language) const;
  225. bool IsSystemIncludeDirectory(const std::string& dir,
  226. const std::string& config) const;
  227. /** Add the target output files to the global generator manifest. */
  228. void ComputeTargetManifest(const std::string& config) const;
  229. /**
  230. * Trace through the source files in this target and add al source files
  231. * that they depend on, used by all generators
  232. */
  233. void TraceDependencies();
  234. /** Get the directory in which this target will be built. If the
  235. configuration name is given then the generator will add its
  236. subdirectory for that configuration. Otherwise just the canonical
  237. output directory is given. */
  238. std::string GetDirectory(const std::string& config = "",
  239. bool implib = false) const;
  240. /** Get the directory in which to place the target compiler .pdb file.
  241. If the configuration name is given then the generator will add its
  242. subdirectory for that configuration. Otherwise just the canonical
  243. compiler pdb output directory is given. */
  244. std::string GetCompilePDBDirectory(const std::string& config = "") const;
  245. /** Get sources that must be built before the given source. */
  246. std::vector<cmSourceFile*> const*
  247. GetSourceDepends(cmSourceFile const* sf) const;
  248. /** Return whether this target uses the default value for its output
  249. directory. */
  250. bool UsesDefaultOutputDir(const std::string& config, bool implib) const;
  251. // Cache target output paths for each configuration.
  252. struct OutputInfo
  253. {
  254. std::string OutDir;
  255. std::string ImpDir;
  256. std::string PdbDir;
  257. bool empty() const
  258. { return OutDir.empty() && ImpDir.empty() && PdbDir.empty(); }
  259. };
  260. OutputInfo const* GetOutputInfo(const std::string& config) const;
  261. /** Get the name of the pdb file for the target. */
  262. std::string GetPDBName(const std::string& config="") const;
  263. /** Whether this library has soname enabled and platform supports it. */
  264. bool HasSOName(const std::string& config) const;
  265. struct CompileInfo
  266. {
  267. std::string CompilePdbDir;
  268. };
  269. CompileInfo const* GetCompileInfo(const std::string& config) const;
  270. typedef std::map<std::string, CompileInfo> CompileInfoMapType;
  271. mutable CompileInfoMapType CompileInfoMap;
  272. bool IsNullImpliedByLinkLibraries(const std::string &p) const;
  273. /** Get the name of the compiler pdb file for the target. */
  274. std::string GetCompilePDBName(const std::string& config="") const;
  275. /** Get the path for the MSVC /Fd option for this target. */
  276. std::string GetCompilePDBPath(const std::string& config="") const;
  277. // Get the target base name.
  278. std::string GetOutputName(const std::string& config, bool implib) const;
  279. void AddSource(const std::string& src);
  280. void AddTracedSources(std::vector<std::string> const& srcs);
  281. /**
  282. * Flags for a given source file as used in this target. Typically assigned
  283. * via SET_TARGET_PROPERTIES when the property is a list of source files.
  284. */
  285. enum SourceFileType
  286. {
  287. SourceFileTypeNormal,
  288. SourceFileTypePrivateHeader, // is in "PRIVATE_HEADER" target property
  289. SourceFileTypePublicHeader, // is in "PUBLIC_HEADER" target property
  290. SourceFileTypeResource, // is in "RESOURCE" target property *or*
  291. // has MACOSX_PACKAGE_LOCATION=="Resources"
  292. SourceFileTypeMacContent // has MACOSX_PACKAGE_LOCATION!="Resources"
  293. };
  294. struct SourceFileFlags
  295. {
  296. SourceFileFlags(): Type(SourceFileTypeNormal), MacFolder(0) {}
  297. SourceFileFlags(SourceFileFlags const& r):
  298. Type(r.Type), MacFolder(r.MacFolder) {}
  299. SourceFileType Type;
  300. const char* MacFolder; // location inside Mac content folders
  301. };
  302. void GetAutoUicOptions(std::vector<std::string> &result,
  303. const std::string& config) const;
  304. /** Get the names of the executable needed to generate a build rule
  305. that takes into account executable version numbers. This should
  306. be called only on an executable target. */
  307. void GetExecutableNames(std::string& name, std::string& realName,
  308. std::string& impName, std::string& pdbName,
  309. const std::string& config) const;
  310. /** Get the names of the library needed to generate a build rule
  311. that takes into account shared library version numbers. This
  312. should be called only on a library target. */
  313. void GetLibraryNames(std::string& name, std::string& soName,
  314. std::string& realName, std::string& impName,
  315. std::string& pdbName, const std::string& config) const;
  316. /**
  317. * Compute whether this target must be relinked before installing.
  318. */
  319. bool NeedRelinkBeforeInstall(const std::string& config) const;
  320. /** Return true if builtin chrpath will work for this target */
  321. bool IsChrpathUsed(const std::string& config) const;
  322. /** Get the directory in which this targets .pdb files will be placed.
  323. If the configuration name is given then the generator will add its
  324. subdirectory for that configuration. Otherwise just the canonical
  325. pdb output directory is given. */
  326. std::string GetPDBDirectory(const std::string& config) const;
  327. ///! Return the preferred linker language for this target
  328. std::string GetLinkerLanguage(const std::string& config = "") const;
  329. /** Does this target have a GNU implib to convert to MS format? */
  330. bool HasImplibGNUtoMS() const;
  331. /** Convert the given GNU import library name (.dll.a) to a name with a new
  332. extension (.lib or ${CMAKE_IMPORT_LIBRARY_SUFFIX}). */
  333. bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out,
  334. const char* newExt = 0) const;
  335. bool IsExecutableWithExports() const;
  336. /** Return whether or not the target has a DLL import library. */
  337. bool HasImportLibrary() const;
  338. /** Get a build-tree directory in which to place target support files. */
  339. std::string GetSupportDirectory() const;
  340. /** Return whether this target may be used to link another target. */
  341. bool IsLinkable() const;
  342. /** Return whether this target is a shared library Framework on
  343. Apple. */
  344. bool IsFrameworkOnApple() const;
  345. /** Return whether this target is an executable Bundle on Apple. */
  346. bool IsAppBundleOnApple() const;
  347. /** Return whether this target is a XCTest on Apple. */
  348. bool IsXCTestOnApple() const;
  349. /** Return whether this target is a CFBundle (plugin) on Apple. */
  350. bool IsCFBundleOnApple() const;
  351. struct SourceFileFlags
  352. GetTargetSourceFileFlags(const cmSourceFile* sf) const;
  353. struct ResxData {
  354. mutable std::set<std::string> ExpectedResxHeaders;
  355. mutable std::vector<cmSourceFile const*> ResxSources;
  356. };
  357. struct XamlData {
  358. std::set<std::string> ExpectedXamlHeaders;
  359. std::set<std::string> ExpectedXamlSources;
  360. std::vector<cmSourceFile const*> XamlSources;
  361. };
  362. void ReportPropertyOrigin(const std::string &p,
  363. const std::string &result,
  364. const std::string &report,
  365. const std::string &compatibilityType) const;
  366. class TargetPropertyEntry;
  367. bool HaveInstallTreeRPATH() const;
  368. /** Whether this library has \@rpath and platform supports it. */
  369. bool HasMacOSXRpathInstallNameDir(const std::string& config) const;
  370. /** Whether this library defaults to \@rpath. */
  371. bool MacOSXRpathInstallNameDirDefault() const;
  372. /** Test for special case of a third-party shared library that has
  373. no soname at all. */
  374. bool IsImportedSharedLibWithoutSOName(const std::string& config) const;
  375. const char* ImportedGetLocation(const std::string& config) const;
  376. /** Get the target major and minor version numbers interpreted from
  377. the VERSION property. Version 0 is returned if the property is
  378. not set or cannot be parsed. */
  379. void GetTargetVersion(int& major, int& minor) const;
  380. /** Get the target major, minor, and patch version numbers
  381. interpreted from the VERSION or SOVERSION property. Version 0
  382. is returned if the property is not set or cannot be parsed. */
  383. void
  384. GetTargetVersion(bool soversion, int& major, int& minor, int& patch) const;
  385. private:
  386. friend class cmTargetTraceDependencies;
  387. struct SourceEntry { std::vector<cmSourceFile*> Depends; };
  388. typedef std::map<cmSourceFile const*, SourceEntry> SourceEntriesType;
  389. SourceEntriesType SourceDepends;
  390. mutable std::map<cmSourceFile const*, std::string> Objects;
  391. std::set<cmSourceFile const*> ExplicitObjectName;
  392. mutable std::map<std::string, std::vector<std::string> > SystemIncludesCache;
  393. mutable std::string ExportMacro;
  394. void ConstructSourceFileFlags() const;
  395. mutable bool SourceFileFlagsConstructed;
  396. mutable std::map<cmSourceFile const*, SourceFileFlags> SourceFlagsMap;
  397. mutable std::map<std::string, bool> DebugCompatiblePropertiesDone;
  398. std::string GetFullNameInternal(const std::string& config,
  399. bool implib) const;
  400. void GetFullNameInternal(const std::string& config, bool implib,
  401. std::string& outPrefix, std::string& outBase,
  402. std::string& outSuffix) const;
  403. typedef std::map<std::string, LinkClosure> LinkClosureMapType;
  404. mutable LinkClosureMapType LinkClosureMap;
  405. // Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type.
  406. const char* GetOutputTargetType(bool implib) const;
  407. void ComputeVersionedName(std::string& vName,
  408. std::string const& prefix,
  409. std::string const& base,
  410. std::string const& suffix,
  411. std::string const& name,
  412. const char* version) const;
  413. struct CompatibleInterfacesBase
  414. {
  415. std::set<std::string> PropsBool;
  416. std::set<std::string> PropsString;
  417. std::set<std::string> PropsNumberMax;
  418. std::set<std::string> PropsNumberMin;
  419. };
  420. CompatibleInterfacesBase const&
  421. GetCompatibleInterfaces(std::string const& config) const;
  422. struct CompatibleInterfaces: public CompatibleInterfacesBase
  423. {
  424. CompatibleInterfaces(): Done(false) {}
  425. bool Done;
  426. };
  427. mutable std::map<std::string, CompatibleInterfaces> CompatibleInterfacesMap;
  428. typedef std::map<std::string, cmComputeLinkInformation*>
  429. cmTargetLinkInformationMap;
  430. mutable cmTargetLinkInformationMap LinkInformation;
  431. void CheckPropertyCompatibility(cmComputeLinkInformation *info,
  432. const std::string& config) const;
  433. cmGeneratorTarget(cmGeneratorTarget const&);
  434. void operator=(cmGeneratorTarget const&);
  435. struct LinkImplClosure: public std::vector<cmGeneratorTarget const*>
  436. {
  437. LinkImplClosure(): Done(false) {}
  438. bool Done;
  439. };
  440. mutable std::map<std::string, LinkImplClosure> LinkImplClosureMap;
  441. typedef std::map<std::string, cmHeadToLinkInterfaceMap>
  442. LinkInterfaceMapType;
  443. mutable LinkInterfaceMapType LinkInterfaceMap;
  444. mutable LinkInterfaceMapType LinkInterfaceUsageRequirementsOnlyMap;
  445. cmHeadToLinkInterfaceMap&
  446. GetHeadToLinkInterfaceMap(std::string const& config) const;
  447. cmHeadToLinkInterfaceMap& GetHeadToLinkInterfaceUsageRequirementsMap(
  448. std::string const& config) const;
  449. // Cache import information from properties for each configuration.
  450. struct ImportInfo
  451. {
  452. ImportInfo(): NoSOName(false), Multiplicity(0) {}
  453. bool NoSOName;
  454. int Multiplicity;
  455. std::string Location;
  456. std::string SOName;
  457. std::string ImportLibrary;
  458. std::string Languages;
  459. std::string Libraries;
  460. std::string LibrariesProp;
  461. std::string SharedDeps;
  462. };
  463. typedef std::map<std::string, ImportInfo> ImportInfoMapType;
  464. mutable ImportInfoMapType ImportInfoMap;
  465. void ComputeImportInfo(std::string const& desired_config,
  466. ImportInfo& info) const;
  467. ImportInfo const* GetImportInfo(const std::string& config) const;
  468. /** Strip off leading and trailing whitespace from an item named in
  469. the link dependencies of this target. */
  470. std::string CheckCMP0004(std::string const& item) const;
  471. cmLinkInterface const*
  472. GetImportLinkInterface(const std::string& config,
  473. const cmGeneratorTarget* head,
  474. bool usage_requirements_only) const;
  475. typedef std::map<std::string, std::vector<cmSourceFile*> >
  476. SourceFilesMapType;
  477. mutable SourceFilesMapType SourceFilesMap;
  478. std::vector<TargetPropertyEntry*> IncludeDirectoriesEntries;
  479. std::vector<TargetPropertyEntry*> CompileOptionsEntries;
  480. std::vector<TargetPropertyEntry*> CompileFeaturesEntries;
  481. std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
  482. std::vector<TargetPropertyEntry*> SourceEntries;
  483. mutable std::set<std::string> LinkImplicitNullProperties;
  484. void ExpandLinkItems(std::string const& prop, std::string const& value,
  485. std::string const& config,
  486. const cmGeneratorTarget* headTarget,
  487. bool usage_requirements_only,
  488. std::vector<cmLinkItem>& items,
  489. bool& hadHeadSensitiveCondition) const;
  490. void LookupLinkItems(std::vector<std::string> const& names,
  491. std::vector<cmLinkItem>& items) const;
  492. void GetSourceFiles(std::vector<std::string>& files,
  493. const std::string& config) const;
  494. struct HeadToLinkImplementationMap:
  495. public std::map<cmTarget const*, cmOptionalLinkImplementation> {};
  496. typedef std::map<std::string,
  497. HeadToLinkImplementationMap> LinkImplMapType;
  498. mutable LinkImplMapType LinkImplMap;
  499. cmLinkImplementationLibraries const*
  500. GetLinkImplementationLibrariesInternal(const std::string& config,
  501. const cmGeneratorTarget* head) const;
  502. bool
  503. ComputeOutputDir(const std::string& config,
  504. bool implib, std::string& out) const;
  505. typedef std::map<std::string, OutputInfo> OutputInfoMapType;
  506. mutable OutputInfoMapType OutputInfoMap;
  507. typedef std::pair<std::string, bool> OutputNameKey;
  508. typedef std::map<OutputNameKey, std::string> OutputNameMapType;
  509. mutable OutputNameMapType OutputNameMap;
  510. mutable std::set<cmLinkItem> UtilityItems;
  511. cmPolicies::PolicyMap PolicyMap;
  512. mutable bool PolicyWarnedCMP0022;
  513. mutable bool DebugIncludesDone;
  514. mutable bool DebugCompileOptionsDone;
  515. mutable bool DebugCompileFeaturesDone;
  516. mutable bool DebugCompileDefinitionsDone;
  517. mutable bool DebugSourcesDone;
  518. mutable bool LinkImplementationLanguageIsContextDependent;
  519. mutable bool UtilityItemsDone;
  520. bool DLLPlatform;
  521. bool ComputePDBOutputDir(const std::string& kind, const std::string& config,
  522. std::string& out) const;
  523. public:
  524. const std::vector<const cmGeneratorTarget*>&
  525. GetLinkImplementationClosure(const std::string& config) const;
  526. mutable std::map<std::string, std::string> MaxLanguageStandards;
  527. std::map<std::string, std::string> const&
  528. GetMaxLanguageStandards() const
  529. {
  530. return this->MaxLanguageStandards;
  531. }
  532. };
  533. struct cmStrictTargetComparison {
  534. bool operator()(cmTarget const* t1, cmTarget const* t2) const;
  535. };
  536. typedef std::map<cmTarget const*,
  537. cmGeneratorTarget*,
  538. cmStrictTargetComparison> cmGeneratorTargetsType;
  539. #endif