cmTargetLinkLibrariesCommand.cxx 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmTargetLinkLibrariesCommand.h"
  4. #include <sstream>
  5. #include <string.h>
  6. #include "cmGeneratorExpression.h"
  7. #include "cmGlobalGenerator.h"
  8. #include "cmMakefile.h"
  9. #include "cmPolicies.h"
  10. #include "cmState.h"
  11. #include "cmStateTypes.h"
  12. #include "cmSystemTools.h"
  13. #include "cmTarget.h"
  14. #include "cmake.h"
  15. class cmExecutionStatus;
  16. const char* cmTargetLinkLibrariesCommand::LinkLibraryTypeNames[3] = {
  17. "general", "debug", "optimized"
  18. };
  19. // cmTargetLinkLibrariesCommand
  20. bool cmTargetLinkLibrariesCommand::InitialPass(
  21. std::vector<std::string> const& args, cmExecutionStatus&)
  22. {
  23. // Must have at least one argument.
  24. if (args.empty()) {
  25. this->SetError("called with incorrect number of arguments");
  26. return false;
  27. }
  28. // Alias targets cannot be on the LHS of this command.
  29. if (this->Makefile->IsAlias(args[0])) {
  30. this->SetError("can not be used on an ALIAS target.");
  31. return false;
  32. }
  33. // Lookup the target for which libraries are specified.
  34. this->Target =
  35. this->Makefile->GetCMakeInstance()->GetGlobalGenerator()->FindTarget(
  36. args[0]);
  37. if (!this->Target) {
  38. const std::vector<cmTarget*>& importedTargets =
  39. this->Makefile->GetOwnedImportedTargets();
  40. for (cmTarget* importedTarget : importedTargets) {
  41. if (importedTarget->GetName() == args[0]) {
  42. this->Target = importedTarget;
  43. break;
  44. }
  45. }
  46. }
  47. if (!this->Target) {
  48. cmake::MessageType t = cmake::FATAL_ERROR; // fail by default
  49. std::ostringstream e;
  50. e << "Cannot specify link libraries for target \"" << args[0] << "\" "
  51. << "which is not built by this project.";
  52. // The bad target is the only argument. Check how policy CMP0016 is set,
  53. // and accept, warn or fail respectively:
  54. if (args.size() < 2) {
  55. switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0016)) {
  56. case cmPolicies::WARN:
  57. t = cmake::AUTHOR_WARNING;
  58. // Print the warning.
  59. e << "\n"
  60. << "CMake does not support this but it used to work accidentally "
  61. << "and is being allowed for compatibility."
  62. << "\n"
  63. << cmPolicies::GetPolicyWarning(cmPolicies::CMP0016);
  64. break;
  65. case cmPolicies::OLD: // OLD behavior does not warn.
  66. t = cmake::MESSAGE;
  67. break;
  68. case cmPolicies::REQUIRED_IF_USED:
  69. case cmPolicies::REQUIRED_ALWAYS:
  70. e << "\n" << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0016);
  71. break;
  72. case cmPolicies::NEW: // NEW behavior prints the error.
  73. break;
  74. }
  75. }
  76. // Now actually print the message.
  77. switch (t) {
  78. case cmake::AUTHOR_WARNING:
  79. this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str());
  80. break;
  81. case cmake::FATAL_ERROR:
  82. this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
  83. cmSystemTools::SetFatalErrorOccured();
  84. break;
  85. default:
  86. break;
  87. }
  88. return true;
  89. }
  90. // Having a UTILITY library on the LHS is a bug.
  91. if (this->Target->GetType() == cmStateEnums::UTILITY) {
  92. std::ostringstream e;
  93. const char* modal = nullptr;
  94. cmake::MessageType messageType = cmake::AUTHOR_WARNING;
  95. switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0039)) {
  96. case cmPolicies::WARN:
  97. e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0039) << "\n";
  98. modal = "should";
  99. case cmPolicies::OLD:
  100. break;
  101. case cmPolicies::REQUIRED_ALWAYS:
  102. case cmPolicies::REQUIRED_IF_USED:
  103. case cmPolicies::NEW:
  104. modal = "must";
  105. messageType = cmake::FATAL_ERROR;
  106. }
  107. if (modal) {
  108. e << "Utility target \"" << this->Target->GetName() << "\" " << modal
  109. << " not be used as the target of a target_link_libraries call.";
  110. this->Makefile->IssueMessage(messageType, e.str());
  111. if (messageType == cmake::FATAL_ERROR) {
  112. return false;
  113. }
  114. }
  115. }
  116. // But we might not have any libs after variable expansion.
  117. if (args.size() < 2) {
  118. return true;
  119. }
  120. // Keep track of link configuration specifiers.
  121. cmTargetLinkLibraryType llt = GENERAL_LibraryType;
  122. bool haveLLT = false;
  123. // Start with primary linking and switch to link interface
  124. // specification if the keyword is encountered as the first argument.
  125. this->CurrentProcessingState = ProcessingLinkLibraries;
  126. // Add libraries, note that there is an optional prefix
  127. // of debug and optimized that can be used.
  128. for (unsigned int i = 1; i < args.size(); ++i) {
  129. if (args[i] == "LINK_INTERFACE_LIBRARIES") {
  130. this->CurrentProcessingState = ProcessingPlainLinkInterface;
  131. if (i != 1) {
  132. this->Makefile->IssueMessage(
  133. cmake::FATAL_ERROR,
  134. "The LINK_INTERFACE_LIBRARIES option must appear as the second "
  135. "argument, just after the target name.");
  136. return true;
  137. }
  138. } else if (args[i] == "INTERFACE") {
  139. if (i != 1 &&
  140. this->CurrentProcessingState != ProcessingKeywordPrivateInterface &&
  141. this->CurrentProcessingState != ProcessingKeywordPublicInterface &&
  142. this->CurrentProcessingState != ProcessingKeywordLinkInterface) {
  143. this->Makefile->IssueMessage(
  144. cmake::FATAL_ERROR,
  145. "The INTERFACE, PUBLIC or PRIVATE option must appear as the second "
  146. "argument, just after the target name.");
  147. return true;
  148. }
  149. this->CurrentProcessingState = ProcessingKeywordLinkInterface;
  150. } else if (args[i] == "LINK_PUBLIC") {
  151. if (i != 1 &&
  152. this->CurrentProcessingState != ProcessingPlainPrivateInterface &&
  153. this->CurrentProcessingState != ProcessingPlainPublicInterface) {
  154. this->Makefile->IssueMessage(
  155. cmake::FATAL_ERROR,
  156. "The LINK_PUBLIC or LINK_PRIVATE option must appear as the second "
  157. "argument, just after the target name.");
  158. return true;
  159. }
  160. this->CurrentProcessingState = ProcessingPlainPublicInterface;
  161. } else if (args[i] == "PUBLIC") {
  162. if (i != 1 &&
  163. this->CurrentProcessingState != ProcessingKeywordPrivateInterface &&
  164. this->CurrentProcessingState != ProcessingKeywordPublicInterface &&
  165. this->CurrentProcessingState != ProcessingKeywordLinkInterface) {
  166. this->Makefile->IssueMessage(
  167. cmake::FATAL_ERROR,
  168. "The INTERFACE, PUBLIC or PRIVATE option must appear as the second "
  169. "argument, just after the target name.");
  170. return true;
  171. }
  172. this->CurrentProcessingState = ProcessingKeywordPublicInterface;
  173. } else if (args[i] == "LINK_PRIVATE") {
  174. if (i != 1 &&
  175. this->CurrentProcessingState != ProcessingPlainPublicInterface &&
  176. this->CurrentProcessingState != ProcessingPlainPrivateInterface) {
  177. this->Makefile->IssueMessage(
  178. cmake::FATAL_ERROR,
  179. "The LINK_PUBLIC or LINK_PRIVATE option must appear as the second "
  180. "argument, just after the target name.");
  181. return true;
  182. }
  183. this->CurrentProcessingState = ProcessingPlainPrivateInterface;
  184. } else if (args[i] == "PRIVATE") {
  185. if (i != 1 &&
  186. this->CurrentProcessingState != ProcessingKeywordPrivateInterface &&
  187. this->CurrentProcessingState != ProcessingKeywordPublicInterface &&
  188. this->CurrentProcessingState != ProcessingKeywordLinkInterface) {
  189. this->Makefile->IssueMessage(
  190. cmake::FATAL_ERROR,
  191. "The INTERFACE, PUBLIC or PRIVATE option must appear as the second "
  192. "argument, just after the target name.");
  193. return true;
  194. }
  195. this->CurrentProcessingState = ProcessingKeywordPrivateInterface;
  196. } else if (args[i] == "debug") {
  197. if (haveLLT) {
  198. this->LinkLibraryTypeSpecifierWarning(llt, DEBUG_LibraryType);
  199. }
  200. llt = DEBUG_LibraryType;
  201. haveLLT = true;
  202. } else if (args[i] == "optimized") {
  203. if (haveLLT) {
  204. this->LinkLibraryTypeSpecifierWarning(llt, OPTIMIZED_LibraryType);
  205. }
  206. llt = OPTIMIZED_LibraryType;
  207. haveLLT = true;
  208. } else if (args[i] == "general") {
  209. if (haveLLT) {
  210. this->LinkLibraryTypeSpecifierWarning(llt, GENERAL_LibraryType);
  211. }
  212. llt = GENERAL_LibraryType;
  213. haveLLT = true;
  214. } else if (haveLLT) {
  215. // The link type was specified by the previous argument.
  216. haveLLT = false;
  217. if (!this->HandleLibrary(args[i], llt)) {
  218. return false;
  219. }
  220. } else {
  221. // Lookup old-style cache entry if type is unspecified. So if you
  222. // do a target_link_libraries(foo optimized bar) it will stay optimized
  223. // and not use the lookup. As there may be the case where someone has
  224. // specified that a library is both debug and optimized. (this check is
  225. // only there for backwards compatibility when mixing projects built
  226. // with old versions of CMake and new)
  227. llt = GENERAL_LibraryType;
  228. std::string linkType = args[0];
  229. linkType += "_LINK_TYPE";
  230. const char* linkTypeString = this->Makefile->GetDefinition(linkType);
  231. if (linkTypeString) {
  232. if (strcmp(linkTypeString, "debug") == 0) {
  233. llt = DEBUG_LibraryType;
  234. }
  235. if (strcmp(linkTypeString, "optimized") == 0) {
  236. llt = OPTIMIZED_LibraryType;
  237. }
  238. }
  239. if (!this->HandleLibrary(args[i], llt)) {
  240. return false;
  241. }
  242. }
  243. }
  244. // Make sure the last argument was not a library type specifier.
  245. if (haveLLT) {
  246. std::ostringstream e;
  247. e << "The \"" << cmTargetLinkLibrariesCommand::LinkLibraryTypeNames[llt]
  248. << "\" argument must be followed by a library.";
  249. this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
  250. cmSystemTools::SetFatalErrorOccured();
  251. }
  252. const cmPolicies::PolicyStatus policy22Status =
  253. this->Target->GetPolicyStatusCMP0022();
  254. // If any of the LINK_ options were given, make sure the
  255. // LINK_INTERFACE_LIBRARIES target property exists.
  256. // Use of any of the new keywords implies awareness of
  257. // this property. And if no libraries are named, it should
  258. // result in an empty link interface.
  259. if ((policy22Status == cmPolicies::OLD ||
  260. policy22Status == cmPolicies::WARN) &&
  261. this->CurrentProcessingState != ProcessingLinkLibraries &&
  262. !this->Target->GetProperty("LINK_INTERFACE_LIBRARIES")) {
  263. this->Target->SetProperty("LINK_INTERFACE_LIBRARIES", "");
  264. }
  265. return true;
  266. }
  267. void cmTargetLinkLibrariesCommand::LinkLibraryTypeSpecifierWarning(int left,
  268. int right)
  269. {
  270. std::ostringstream w;
  271. w << "Link library type specifier \""
  272. << cmTargetLinkLibrariesCommand::LinkLibraryTypeNames[left]
  273. << "\" is followed by specifier \""
  274. << cmTargetLinkLibrariesCommand::LinkLibraryTypeNames[right]
  275. << "\" instead of a library name. "
  276. << "The first specifier will be ignored.";
  277. this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
  278. }
  279. bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
  280. cmTargetLinkLibraryType llt)
  281. {
  282. if (this->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY &&
  283. this->CurrentProcessingState != ProcessingKeywordLinkInterface) {
  284. this->Makefile->IssueMessage(
  285. cmake::FATAL_ERROR,
  286. "INTERFACE library can only be used with the INTERFACE keyword of "
  287. "target_link_libraries");
  288. return false;
  289. }
  290. if (this->Target->IsImported() &&
  291. this->CurrentProcessingState != ProcessingKeywordLinkInterface) {
  292. this->Makefile->IssueMessage(
  293. cmake::FATAL_ERROR,
  294. "IMPORTED library can only be used with the INTERFACE keyword of "
  295. "target_link_libraries");
  296. return false;
  297. }
  298. cmTarget::TLLSignature sig =
  299. (this->CurrentProcessingState == ProcessingPlainPrivateInterface ||
  300. this->CurrentProcessingState == ProcessingPlainPublicInterface ||
  301. this->CurrentProcessingState == ProcessingKeywordPrivateInterface ||
  302. this->CurrentProcessingState == ProcessingKeywordPublicInterface ||
  303. this->CurrentProcessingState == ProcessingKeywordLinkInterface)
  304. ? cmTarget::KeywordTLLSignature
  305. : cmTarget::PlainTLLSignature;
  306. if (!this->Target->PushTLLCommandTrace(
  307. sig, this->Makefile->GetExecutionContext())) {
  308. std::ostringstream e;
  309. const char* modal = nullptr;
  310. cmake::MessageType messageType = cmake::AUTHOR_WARNING;
  311. switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0023)) {
  312. case cmPolicies::WARN:
  313. e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0023) << "\n";
  314. modal = "should";
  315. case cmPolicies::OLD:
  316. break;
  317. case cmPolicies::REQUIRED_ALWAYS:
  318. case cmPolicies::REQUIRED_IF_USED:
  319. case cmPolicies::NEW:
  320. modal = "must";
  321. messageType = cmake::FATAL_ERROR;
  322. }
  323. if (modal) {
  324. // If the sig is a keyword form and there is a conflict, the existing
  325. // form must be the plain form.
  326. const char* existingSig =
  327. (sig == cmTarget::KeywordTLLSignature ? "plain" : "keyword");
  328. e << "The " << existingSig
  329. << " signature for target_link_libraries has "
  330. "already been used with the target \""
  331. << this->Target->GetName()
  332. << "\". All uses of target_link_libraries with a target " << modal
  333. << " be either all-keyword or all-plain.\n";
  334. this->Target->GetTllSignatureTraces(e,
  335. sig == cmTarget::KeywordTLLSignature
  336. ? cmTarget::PlainTLLSignature
  337. : cmTarget::KeywordTLLSignature);
  338. this->Makefile->IssueMessage(messageType, e.str());
  339. if (messageType == cmake::FATAL_ERROR) {
  340. return false;
  341. }
  342. }
  343. }
  344. bool warnRemoteInterface = false;
  345. bool rejectRemoteLinking = false;
  346. bool encodeRemoteReference = false;
  347. if (this->Makefile != this->Target->GetMakefile()) {
  348. // The LHS target was created in another directory.
  349. switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0079)) {
  350. case cmPolicies::WARN:
  351. warnRemoteInterface = true;
  352. CM_FALLTHROUGH;
  353. case cmPolicies::OLD:
  354. rejectRemoteLinking = true;
  355. break;
  356. case cmPolicies::REQUIRED_ALWAYS:
  357. case cmPolicies::REQUIRED_IF_USED:
  358. case cmPolicies::NEW:
  359. encodeRemoteReference = true;
  360. break;
  361. }
  362. }
  363. std::string libRef;
  364. if (encodeRemoteReference && !cmSystemTools::FileIsFullPath(lib)) {
  365. // This is a library name added by a caller that is not in the
  366. // same directory as the target was created. Add a suffix to
  367. // the name to tell ResolveLinkItem to look up the name in the
  368. // caller's directory.
  369. cmDirectoryId const dirId = this->Makefile->GetDirectoryId();
  370. libRef = lib + CMAKE_DIRECTORY_ID_SEP + dirId.String;
  371. } else {
  372. // This is an absolute path or a library name added by a caller
  373. // in the same directory as the target was created. We can use
  374. // the original name directly.
  375. libRef = lib;
  376. }
  377. // Handle normal case where the command was called with another keyword than
  378. // INTERFACE / LINK_INTERFACE_LIBRARIES or none at all. (The "LINK_LIBRARIES"
  379. // property of the target on the LHS shall be populated.)
  380. if (this->CurrentProcessingState != ProcessingKeywordLinkInterface &&
  381. this->CurrentProcessingState != ProcessingPlainLinkInterface) {
  382. if (rejectRemoteLinking) {
  383. std::ostringstream e;
  384. e << "Attempt to add link library \"" << lib << "\" to target \""
  385. << this->Target->GetName()
  386. << "\" which is not built in this directory.\n"
  387. << "This is allowed only when policy CMP0079 is set to NEW.";
  388. this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
  389. return false;
  390. }
  391. cmTarget* tgt = this->Makefile->GetGlobalGenerator()->FindTarget(lib);
  392. if (tgt && (tgt->GetType() != cmStateEnums::STATIC_LIBRARY) &&
  393. (tgt->GetType() != cmStateEnums::SHARED_LIBRARY) &&
  394. (tgt->GetType() != cmStateEnums::UNKNOWN_LIBRARY) &&
  395. (tgt->GetType() != cmStateEnums::OBJECT_LIBRARY) &&
  396. (tgt->GetType() != cmStateEnums::INTERFACE_LIBRARY) &&
  397. !tgt->IsExecutableWithExports()) {
  398. std::ostringstream e;
  399. e << "Target \"" << lib << "\" of type "
  400. << cmState::GetTargetTypeName(tgt->GetType())
  401. << " may not be linked into another target. One may link only to "
  402. "INTERFACE, OBJECT, STATIC or SHARED libraries, or to executables "
  403. "with the ENABLE_EXPORTS property set.";
  404. this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
  405. }
  406. this->Target->AddLinkLibrary(*this->Makefile, lib, libRef, llt);
  407. }
  408. if (warnRemoteInterface) {
  409. std::ostringstream w;
  410. /* clang-format off */
  411. w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0079) << "\n"
  412. "Target\n " << this->Target->GetName() << "\nis not created in this "
  413. "directory. For compatibility with older versions of CMake, link "
  414. "library\n " << lib << "\nwill be looked up in the directory in "
  415. "which the target was created rather than in this calling "
  416. "directory.";
  417. /* clang-format on */
  418. this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
  419. }
  420. // Handle (additional) case where the command was called with PRIVATE /
  421. // LINK_PRIVATE and stop its processing. (The "INTERFACE_LINK_LIBRARIES"
  422. // property of the target on the LHS shall only be populated if it is a
  423. // STATIC library.)
  424. if (this->CurrentProcessingState == ProcessingKeywordPrivateInterface ||
  425. this->CurrentProcessingState == ProcessingPlainPrivateInterface) {
  426. if (this->Target->GetType() == cmStateEnums::STATIC_LIBRARY ||
  427. this->Target->GetType() == cmStateEnums::OBJECT_LIBRARY) {
  428. std::string configLib =
  429. this->Target->GetDebugGeneratorExpressions(libRef, llt);
  430. if (cmGeneratorExpression::IsValidTargetName(libRef) ||
  431. cmGeneratorExpression::Find(libRef) != std::string::npos) {
  432. configLib = "$<LINK_ONLY:" + configLib + ">";
  433. }
  434. this->Target->AppendProperty("INTERFACE_LINK_LIBRARIES",
  435. configLib.c_str());
  436. }
  437. return true;
  438. }
  439. // Handle general case where the command was called with another keyword than
  440. // PRIVATE / LINK_PRIVATE or none at all. (The "INTERFACE_LINK_LIBRARIES"
  441. // property of the target on the LHS shall be populated.)
  442. this->Target->AppendProperty(
  443. "INTERFACE_LINK_LIBRARIES",
  444. this->Target->GetDebugGeneratorExpressions(libRef, llt).c_str());
  445. // Stop processing if called without any keyword.
  446. if (this->CurrentProcessingState == ProcessingLinkLibraries) {
  447. return true;
  448. }
  449. // Stop processing if policy CMP0022 is set to NEW.
  450. const cmPolicies::PolicyStatus policy22Status =
  451. this->Target->GetPolicyStatusCMP0022();
  452. if (policy22Status != cmPolicies::OLD &&
  453. policy22Status != cmPolicies::WARN) {
  454. return true;
  455. }
  456. // Stop processing if called with an INTERFACE library on the LHS.
  457. if (this->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
  458. return true;
  459. }
  460. // Handle (additional) backward-compatibility case where the command was
  461. // called with PUBLIC / INTERFACE / LINK_PUBLIC / LINK_INTERFACE_LIBRARIES.
  462. // (The policy CMP0022 is not set to NEW.)
  463. {
  464. // Get the list of configurations considered to be DEBUG.
  465. std::vector<std::string> debugConfigs =
  466. this->Makefile->GetCMakeInstance()->GetDebugConfigs();
  467. std::string prop;
  468. // Include this library in the link interface for the target.
  469. if (llt == DEBUG_LibraryType || llt == GENERAL_LibraryType) {
  470. // Put in the DEBUG configuration interfaces.
  471. for (std::string const& dc : debugConfigs) {
  472. prop = "LINK_INTERFACE_LIBRARIES_";
  473. prop += dc;
  474. this->Target->AppendProperty(prop, libRef.c_str());
  475. }
  476. }
  477. if (llt == OPTIMIZED_LibraryType || llt == GENERAL_LibraryType) {
  478. // Put in the non-DEBUG configuration interfaces.
  479. this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES", libRef.c_str());
  480. // Make sure the DEBUG configuration interfaces exist so that the
  481. // general one will not be used as a fall-back.
  482. for (std::string const& dc : debugConfigs) {
  483. prop = "LINK_INTERFACE_LIBRARIES_";
  484. prop += dc;
  485. if (!this->Target->GetProperty(prop)) {
  486. this->Target->SetProperty(prop, "");
  487. }
  488. }
  489. }
  490. }
  491. return true;
  492. }