cmTarget.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 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 cmTarget_h
  11. #define cmTarget_h
  12. #include "cmCustomCommand.h"
  13. #include "cmPropertyMap.h"
  14. #include "cmPolicies.h"
  15. #include <cmsys/auto_ptr.hxx>
  16. class cmake;
  17. class cmMakefile;
  18. class cmSourceFile;
  19. class cmGlobalGenerator;
  20. class cmComputeLinkInformation;
  21. class cmListFileBacktrace;
  22. struct cmTargetLinkInformationMap:
  23. public std::map<cmStdString, cmComputeLinkInformation*>
  24. {
  25. typedef std::map<cmStdString, cmComputeLinkInformation*> derived;
  26. cmTargetLinkInformationMap() {}
  27. cmTargetLinkInformationMap(cmTargetLinkInformationMap const& r);
  28. ~cmTargetLinkInformationMap();
  29. };
  30. class cmTargetInternals;
  31. class cmTargetInternalPointer
  32. {
  33. public:
  34. cmTargetInternalPointer();
  35. cmTargetInternalPointer(cmTargetInternalPointer const& r);
  36. ~cmTargetInternalPointer();
  37. cmTargetInternalPointer& operator=(cmTargetInternalPointer const& r);
  38. cmTargetInternals* operator->() const { return this->Pointer; }
  39. cmTargetInternals* Get() const { return this->Pointer; }
  40. private:
  41. cmTargetInternals* Pointer;
  42. };
  43. /** \class cmTarget
  44. * \brief Represent a library or executable target loaded from a makefile.
  45. *
  46. * cmTarget represents a target loaded from
  47. * a makefile.
  48. */
  49. class cmTarget
  50. {
  51. public:
  52. cmTarget();
  53. enum TargetType { EXECUTABLE, STATIC_LIBRARY,
  54. SHARED_LIBRARY, MODULE_LIBRARY,
  55. OBJECT_LIBRARY, UTILITY, GLOBAL_TARGET,
  56. UNKNOWN_LIBRARY};
  57. static const char* GetTargetTypeName(TargetType targetType);
  58. enum CustomCommandType { PRE_BUILD, PRE_LINK, POST_BUILD };
  59. /**
  60. * Return the type of target.
  61. */
  62. TargetType GetType() const
  63. {
  64. return this->TargetTypeValue;
  65. }
  66. /**
  67. * Set the target type
  68. */
  69. void SetType(TargetType f, const char* name);
  70. void MarkAsImported();
  71. ///! Set/Get the name of the target
  72. const char* GetName() const {return this->Name.c_str();}
  73. ///! Set the cmMakefile that owns this target
  74. void SetMakefile(cmMakefile *mf);
  75. cmMakefile *GetMakefile() const { return this->Makefile;};
  76. /** Get the status of policy CMP0003 when the target was created. */
  77. cmPolicies::PolicyStatus GetPolicyStatusCMP0003() const
  78. { return this->PolicyStatusCMP0003; }
  79. /** Get the status of policy CMP0004 when the target was created. */
  80. cmPolicies::PolicyStatus GetPolicyStatusCMP0004() const
  81. { return this->PolicyStatusCMP0004; }
  82. /** Get the status of policy CMP0008 when the target was created. */
  83. cmPolicies::PolicyStatus GetPolicyStatusCMP0008() const
  84. { return this->PolicyStatusCMP0008; }
  85. /**
  86. * Get the list of the custom commands for this target
  87. */
  88. std::vector<cmCustomCommand> &GetPreBuildCommands()
  89. {return this->PreBuildCommands;}
  90. std::vector<cmCustomCommand> &GetPreLinkCommands()
  91. {return this->PreLinkCommands;}
  92. std::vector<cmCustomCommand> &GetPostBuildCommands()
  93. {return this->PostBuildCommands;}
  94. ///! Return the list of frameworks being linked to this target
  95. std::vector<std::string> &GetFrameworks() {return this->Frameworks;}
  96. /**
  97. * Get the list of the source files used by this target
  98. */
  99. std::vector<cmSourceFile*> const& GetSourceFiles();
  100. void AddSourceFile(cmSourceFile* sf);
  101. /** Get sources that must be built before the given source. */
  102. std::vector<cmSourceFile*> const* GetSourceDepends(cmSourceFile* sf);
  103. /**
  104. * Flags for a given source file as used in this target. Typically assigned
  105. * via SET_TARGET_PROPERTIES when the property is a list of source files.
  106. */
  107. enum SourceFileType
  108. {
  109. SourceFileTypeNormal,
  110. SourceFileTypePrivateHeader, // is in "PRIVATE_HEADER" target property
  111. SourceFileTypePublicHeader, // is in "PUBLIC_HEADER" target property
  112. SourceFileTypeResource, // is in "RESOURCE" target property *or*
  113. // has MACOSX_PACKAGE_LOCATION=="Resources"
  114. SourceFileTypeMacContent // has MACOSX_PACKAGE_LOCATION!="Resources"
  115. };
  116. struct SourceFileFlags
  117. {
  118. SourceFileFlags(): Type(SourceFileTypeNormal), MacFolder(0) {}
  119. SourceFileFlags(SourceFileFlags const& r):
  120. Type(r.Type), MacFolder(r.MacFolder) {}
  121. SourceFileType Type;
  122. const char* MacFolder; // location inside Mac content folders
  123. };
  124. /**
  125. * Get the flags for a given source file as used in this target
  126. */
  127. struct SourceFileFlags GetTargetSourceFileFlags(const cmSourceFile* sf);
  128. /**
  129. * Add sources to the target.
  130. */
  131. void AddSources(std::vector<std::string> const& srcs);
  132. cmSourceFile* AddSource(const char* src);
  133. /**
  134. * Get the list of the source files used by this target
  135. */
  136. enum LinkLibraryType {GENERAL, DEBUG, OPTIMIZED};
  137. //* how we identify a library, by name and type
  138. typedef std::pair<cmStdString, LinkLibraryType> LibraryID;
  139. typedef std::vector<LibraryID > LinkLibraryVectorType;
  140. const LinkLibraryVectorType &GetLinkLibraries() const {
  141. return this->LinkLibraries;}
  142. const LinkLibraryVectorType &GetOriginalLinkLibraries() const
  143. {return this->OriginalLinkLibraries;}
  144. /** Compute the link type to use for the given configuration. */
  145. LinkLibraryType ComputeLinkType(const char* config);
  146. /**
  147. * Clear the dependency information recorded for this target, if any.
  148. */
  149. void ClearDependencyInformation(cmMakefile& mf, const char* target);
  150. // Check to see if a library is a framework and treat it different on Mac
  151. bool NameResolvesToFramework(const std::string& libname);
  152. bool AddFramework(const std::string& lib, LinkLibraryType llt);
  153. void AddLinkLibrary(cmMakefile& mf,
  154. const char *target, const char* lib,
  155. LinkLibraryType llt);
  156. void MergeLinkLibraries( cmMakefile& mf, const char* selfname,
  157. const LinkLibraryVectorType& libs );
  158. const std::vector<std::string>& GetLinkDirectories();
  159. void AddLinkDirectory(const char* d);
  160. /**
  161. * Set the path where this target should be installed. This is relative to
  162. * INSTALL_PREFIX
  163. */
  164. std::string GetInstallPath() {return this->InstallPath;}
  165. void SetInstallPath(const char *name) {this->InstallPath = name;}
  166. /**
  167. * Set the path where this target (if it has a runtime part) should be
  168. * installed. This is relative to INSTALL_PREFIX
  169. */
  170. std::string GetRuntimeInstallPath() {return this->RuntimeInstallPath;}
  171. void SetRuntimeInstallPath(const char *name) {
  172. this->RuntimeInstallPath = name; }
  173. /**
  174. * Get/Set whether there is an install rule for this target.
  175. */
  176. bool GetHaveInstallRule() { return this->HaveInstallRule; }
  177. void SetHaveInstallRule(bool h) { this->HaveInstallRule = h; }
  178. /** Add a utility on which this project depends. A utility is an executable
  179. * name as would be specified to the ADD_EXECUTABLE or UTILITY_SOURCE
  180. * commands. It is not a full path nor does it have an extension.
  181. */
  182. void AddUtility(const char* u) { this->Utilities.insert(u);}
  183. ///! Get the utilities used by this target
  184. std::set<cmStdString>const& GetUtilities() const { return this->Utilities; }
  185. /** Finalize the target at the end of the Configure step. */
  186. void FinishConfigure();
  187. ///! Set/Get a property of this target file
  188. void SetProperty(const char *prop, const char *value);
  189. void AppendProperty(const char* prop, const char* value,bool asString=false);
  190. const char *GetProperty(const char *prop);
  191. const char *GetProperty(const char *prop, cmProperty::ScopeType scope);
  192. bool GetPropertyAsBool(const char *prop);
  193. void CheckProperty(const char* prop, cmMakefile* context);
  194. const char* GetFeature(const char* feature, const char* config);
  195. bool IsImported() const {return this->IsImportedTarget;}
  196. /** The link interface specifies transitive library dependencies and
  197. other information needed by targets that link to this target. */
  198. struct LinkInterface
  199. {
  200. // Languages whose runtime libraries must be linked.
  201. std::vector<std::string> Languages;
  202. // Libraries listed in the interface.
  203. std::vector<std::string> Libraries;
  204. // Shared library dependencies needed for linking on some platforms.
  205. std::vector<std::string> SharedDeps;
  206. // Number of repetitions of a strongly connected component of two
  207. // or more static libraries.
  208. int Multiplicity;
  209. // Libraries listed for other configurations.
  210. // Needed only for OLD behavior of CMP0003.
  211. std::vector<std::string> WrongConfigLibraries;
  212. LinkInterface(): Multiplicity(0) {}
  213. };
  214. /** Get the link interface for the given configuration. Returns 0
  215. if the target cannot be linked. */
  216. LinkInterface const* GetLinkInterface(const char* config);
  217. /** The link implementation specifies the direct library
  218. dependencies needed by the object files of the target. */
  219. struct LinkImplementation
  220. {
  221. // Languages whose runtime libraries must be linked.
  222. std::vector<std::string> Languages;
  223. // Libraries linked directly in this configuration.
  224. std::vector<std::string> Libraries;
  225. // Libraries linked directly in other configurations.
  226. // Needed only for OLD behavior of CMP0003.
  227. std::vector<std::string> WrongConfigLibraries;
  228. };
  229. LinkImplementation const* GetLinkImplementation(const char* config);
  230. /** Link information from the transitive closure of the link
  231. implementation and the interfaces of its dependencies. */
  232. struct LinkClosure
  233. {
  234. // The preferred linker language.
  235. std::string LinkerLanguage;
  236. // Languages whose runtime libraries must be linked.
  237. std::vector<std::string> Languages;
  238. };
  239. LinkClosure const* GetLinkClosure(const char* config);
  240. /** Strip off leading and trailing whitespace from an item named in
  241. the link dependencies of this target. */
  242. std::string CheckCMP0004(std::string const& item);
  243. /** Get the directory in which this target will be built. If the
  244. configuration name is given then the generator will add its
  245. subdirectory for that configuration. Otherwise just the canonical
  246. output directory is given. */
  247. std::string GetDirectory(const char* config = 0, bool implib = false);
  248. /** Get the location of the target in the build tree for the given
  249. configuration. This location is suitable for use as the LOCATION
  250. target property. */
  251. const char* GetLocation(const char* config);
  252. /** Get the target major and minor version numbers interpreted from
  253. the VERSION property. Version 0 is returned if the property is
  254. not set or cannot be parsed. */
  255. void GetTargetVersion(int& major, int& minor);
  256. /** Get the target major, minor, and patch version numbers
  257. interpreted from the VERSION or SOVERSION property. Version 0
  258. is returned if the property is not set or cannot be parsed. */
  259. void GetTargetVersion(bool soversion, int& major, int& minor, int& patch);
  260. /**
  261. * Trace through the source files in this target and add al source files
  262. * that they depend on, used by all generators
  263. */
  264. void TraceDependencies(const char* vsProjectFile);
  265. /**
  266. * Make sure the full path to all source files is known.
  267. */
  268. bool FindSourceFiles();
  269. ///! Return the preferred linker language for this target
  270. const char* GetLinkerLanguage(const char* config = 0);
  271. ///! Return the rule variable used to create this type of target,
  272. // need to add CMAKE_(LANG) for full name.
  273. const char* GetCreateRuleVariable();
  274. /** Get the full name of the target according to the settings in its
  275. makefile. */
  276. std::string GetFullName(const char* config=0, bool implib = false);
  277. void GetFullNameComponents(std::string& prefix,
  278. std::string& base, std::string& suffix,
  279. const char* config=0, bool implib = false);
  280. /** Get the name of the pdb file for the target. */
  281. std::string GetPDBName(const char* config=0);
  282. /** Get the soname of the target. Allowed only for a shared library. */
  283. std::string GetSOName(const char* config);
  284. /** Test for special case of a third-party shared library that has
  285. no soname at all. */
  286. bool IsImportedSharedLibWithoutSOName(const char* config);
  287. /** Get the full path to the target according to the settings in its
  288. makefile and the configuration type. */
  289. std::string GetFullPath(const char* config=0, bool implib = false,
  290. bool realname = false);
  291. /** Get the names of the library needed to generate a build rule
  292. that takes into account shared library version numbers. This
  293. should be called only on a library target. */
  294. void GetLibraryNames(std::string& name, std::string& soName,
  295. std::string& realName, std::string& impName,
  296. std::string& pdbName, const char* config);
  297. /** Get the names of the executable needed to generate a build rule
  298. that takes into account executable version numbers. This should
  299. be called only on an executable target. */
  300. void GetExecutableNames(std::string& name, std::string& realName,
  301. std::string& impName,
  302. std::string& pdbName, const char* config);
  303. /** Does this target have a GNU implib to convert to MS format? */
  304. bool HasImplibGNUtoMS();
  305. /** Convert the given GNU import library name (.dll.a) to a name with a new
  306. extension (.lib or ${CMAKE_IMPORT_LIBRARY_SUFFIX}). */
  307. bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out,
  308. const char* newExt = 0);
  309. /** Add the target output files to the global generator manifest. */
  310. void GenerateTargetManifest(const char* config);
  311. /**
  312. * Compute whether this target must be relinked before installing.
  313. */
  314. bool NeedRelinkBeforeInstall(const char* config);
  315. bool HaveBuildTreeRPATH();
  316. bool HaveInstallTreeRPATH();
  317. /** Return true if builtin chrpath will work for this target */
  318. bool IsChrpathUsed(const char* config);
  319. std::string GetInstallNameDirForBuildTree(const char* config,
  320. bool for_xcode = false);
  321. std::string GetInstallNameDirForInstallTree(const char* config,
  322. bool for_xcode = false);
  323. cmComputeLinkInformation* GetLinkInformation(const char* config);
  324. // Get the properties
  325. cmPropertyMap &GetProperties() { return this->Properties; };
  326. // Define the properties
  327. static void DefineProperties(cmake *cm);
  328. /** Get the macro to define when building sources in this target.
  329. If no macro should be defined null is returned. */
  330. const char* GetExportMacro();
  331. // Compute the set of languages compiled by the target. This is
  332. // computed every time it is called because the languages can change
  333. // when source file properties are changed and we do not have enough
  334. // information to forward these property changes to the targets
  335. // until we have per-target object file properties.
  336. void GetLanguages(std::set<cmStdString>& languages) const;
  337. /** Get the list of OS X target architectures to be built. */
  338. void GetAppleArchs(const char* config, std::vector<std::string>& archVec);
  339. /** Return whether this target is an executable with symbol exports
  340. enabled. */
  341. bool IsExecutableWithExports();
  342. /** Return whether this target may be used to link another target. */
  343. bool IsLinkable();
  344. /** Return whether or not the target is for a DLL platform. */
  345. bool IsDLLPlatform() { return this->DLLPlatform; }
  346. /** Return whether or not the target has a DLL import library. */
  347. bool HasImportLibrary();
  348. /** Return whether this target is a shared library Framework on
  349. Apple. */
  350. bool IsFrameworkOnApple();
  351. /** Return whether this target is a CFBundle (plugin) on Apple. */
  352. bool IsCFBundleOnApple();
  353. /** Return whether this target is an executable Bundle on Apple. */
  354. bool IsAppBundleOnApple();
  355. /** Return the framework version string. Undefined if
  356. IsFrameworkOnApple returns false. */
  357. std::string GetFrameworkVersion();
  358. /** Get a backtrace from the creation of the target. */
  359. cmListFileBacktrace const& GetBacktrace() const;
  360. /** Get a build-tree directory in which to place target support files. */
  361. std::string GetSupportDirectory() const;
  362. /** Return whether this target uses the default value for its output
  363. directory. */
  364. bool UsesDefaultOutputDir(const char* config, bool implib);
  365. /** Get the include directories for this target. */
  366. std::vector<std::string> GetIncludeDirectories();
  367. private:
  368. /**
  369. * A list of direct dependencies. Use in conjunction with DependencyMap.
  370. */
  371. typedef std::vector< LibraryID > DependencyList;
  372. /**
  373. * This map holds the dependency graph. map[x] returns a set of
  374. * direct dependencies of x. Note that the direct depenencies are
  375. * ordered. This is necessary to handle direct dependencies that
  376. * themselves have no dependency information.
  377. */
  378. typedef std::map< LibraryID, DependencyList > DependencyMap;
  379. /**
  380. * Inserts \a dep at the end of the dependency list of \a lib.
  381. */
  382. void InsertDependency( DependencyMap& depMap,
  383. const LibraryID& lib,
  384. const LibraryID& dep);
  385. /*
  386. * Deletes \a dep from the dependency list of \a lib.
  387. */
  388. void DeleteDependency( DependencyMap& depMap,
  389. const LibraryID& lib,
  390. const LibraryID& dep);
  391. /**
  392. * Emits the library \a lib and all its dependencies into link_line.
  393. * \a emitted keeps track of the libraries that have been emitted to
  394. * avoid duplicates--it is more efficient than searching
  395. * link_line. \a visited is used detect cycles. Note that \a
  396. * link_line is in reverse order, in that the dependencies of a
  397. * library are listed before the library itself.
  398. */
  399. void Emit( const LibraryID lib,
  400. const DependencyMap& dep_map,
  401. std::set<LibraryID>& emitted,
  402. std::set<LibraryID>& visited,
  403. DependencyList& link_line);
  404. /**
  405. * Finds the dependencies for \a lib and inserts them into \a
  406. * dep_map.
  407. */
  408. void GatherDependencies( const cmMakefile& mf,
  409. const LibraryID& lib,
  410. DependencyMap& dep_map);
  411. void AnalyzeLibDependencies( const cmMakefile& mf );
  412. const char* GetSuffixVariableInternal(bool implib);
  413. const char* GetPrefixVariableInternal(bool implib);
  414. std::string GetFullNameInternal(const char* config, bool implib);
  415. void GetFullNameInternal(const char* config, bool implib,
  416. std::string& outPrefix, std::string& outBase,
  417. std::string& outSuffix);
  418. // Use a makefile variable to set a default for the given property.
  419. // If the variable is not defined use the given default instead.
  420. void SetPropertyDefault(const char* property, const char* default_value);
  421. // Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type.
  422. const char* GetOutputTargetType(bool implib);
  423. // Get the target base name.
  424. std::string GetOutputName(const char* config, bool implib);
  425. const char* ImportedGetLocation(const char* config);
  426. const char* NormalGetLocation(const char* config);
  427. std::string GetFullNameImported(const char* config, bool implib);
  428. std::string ImportedGetFullPath(const char* config, bool implib);
  429. std::string NormalGetFullPath(const char* config, bool implib,
  430. bool realname);
  431. /** Get the real name of the target. Allowed only for non-imported
  432. targets. When a library or executable file is versioned this is
  433. the full versioned name. If the target is not versioned this is
  434. the same as GetFullName. */
  435. std::string NormalGetRealName(const char* config);
  436. private:
  437. std::string Name;
  438. std::vector<cmCustomCommand> PreBuildCommands;
  439. std::vector<cmCustomCommand> PreLinkCommands;
  440. std::vector<cmCustomCommand> PostBuildCommands;
  441. TargetType TargetTypeValue;
  442. std::vector<cmSourceFile*> SourceFiles;
  443. LinkLibraryVectorType LinkLibraries;
  444. LinkLibraryVectorType PrevLinkedLibraries;
  445. bool LinkLibrariesAnalyzed;
  446. std::vector<std::string> Frameworks;
  447. std::vector<std::string> LinkDirectories;
  448. std::set<cmStdString> LinkDirectoriesEmmitted;
  449. bool HaveInstallRule;
  450. std::string InstallPath;
  451. std::string RuntimeInstallPath;
  452. std::string Location;
  453. std::string ExportMacro;
  454. std::set<cmStdString> Utilities;
  455. bool RecordDependencies;
  456. cmPropertyMap Properties;
  457. LinkLibraryVectorType OriginalLinkLibraries;
  458. bool DLLPlatform;
  459. bool IsApple;
  460. bool IsImportedTarget;
  461. // Cache target output paths for each configuration.
  462. struct OutputInfo;
  463. OutputInfo const* GetOutputInfo(const char* config);
  464. bool ComputeOutputDir(const char* config, bool implib, std::string& out);
  465. // Cache import information from properties for each configuration.
  466. struct ImportInfo;
  467. ImportInfo const* GetImportInfo(const char* config);
  468. void ComputeImportInfo(std::string const& desired_config, ImportInfo& info);
  469. cmTargetLinkInformationMap LinkInformation;
  470. bool ComputeLinkInterface(const char* config, LinkInterface& iface);
  471. void ComputeLinkImplementation(const char* config,
  472. LinkImplementation& impl);
  473. void ComputeLinkClosure(const char* config, LinkClosure& lc);
  474. void ClearLinkMaps();
  475. void MaybeInvalidatePropertyCache(const char* prop);
  476. // The cmMakefile instance that owns this target. This should
  477. // always be set.
  478. cmMakefile* Makefile;
  479. // Policy status recorded when target was created.
  480. cmPolicies::PolicyStatus PolicyStatusCMP0003;
  481. cmPolicies::PolicyStatus PolicyStatusCMP0004;
  482. cmPolicies::PolicyStatus PolicyStatusCMP0008;
  483. // Internal representation details.
  484. friend class cmTargetInternals;
  485. cmTargetInternalPointer Internal;
  486. void ConstructSourceFileFlags();
  487. void ComputeVersionedName(std::string& vName,
  488. std::string const& prefix,
  489. std::string const& base,
  490. std::string const& suffix,
  491. std::string const& name,
  492. const char* version);
  493. };
  494. typedef std::map<cmStdString,cmTarget> cmTargets;
  495. class cmTargetSet: public std::set<cmStdString> {};
  496. class cmTargetManifest: public std::map<cmStdString, cmTargetSet> {};
  497. #endif