cmVisualStudioGeneratorOptions.cxx 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. #include "cmVisualStudioGeneratorOptions.h"
  2. #include "cmAlgorithms.h"
  3. #include "cmLocalVisualStudioGenerator.h"
  4. #include "cmOutputConverter.h"
  5. #include "cmSystemTools.h"
  6. #include "cmVisualStudio10TargetGenerator.h"
  7. static std::string cmVisualStudio10GeneratorOptionsEscapeForXML(
  8. std::string ret)
  9. {
  10. cmSystemTools::ReplaceString(ret, ";", "%3B");
  11. cmSystemTools::ReplaceString(ret, "&", "&");
  12. cmSystemTools::ReplaceString(ret, "<", "&lt;");
  13. cmSystemTools::ReplaceString(ret, ">", "&gt;");
  14. return ret;
  15. }
  16. static std::string cmVisualStudioGeneratorOptionsEscapeForXML(std::string ret)
  17. {
  18. cmSystemTools::ReplaceString(ret, "&", "&amp;");
  19. cmSystemTools::ReplaceString(ret, "\"", "&quot;");
  20. cmSystemTools::ReplaceString(ret, "<", "&lt;");
  21. cmSystemTools::ReplaceString(ret, ">", "&gt;");
  22. cmSystemTools::ReplaceString(ret, "\n", "&#x0D;&#x0A;");
  23. return ret;
  24. }
  25. cmVisualStudioGeneratorOptions::cmVisualStudioGeneratorOptions(
  26. cmLocalVisualStudioGenerator* lg, Tool tool,
  27. cmVisualStudio10TargetGenerator* g)
  28. : cmVisualStudioGeneratorOptions(lg, tool, nullptr, nullptr, g)
  29. {
  30. }
  31. cmVisualStudioGeneratorOptions::cmVisualStudioGeneratorOptions(
  32. cmLocalVisualStudioGenerator* lg, Tool tool, cmVS7FlagTable const* table,
  33. cmVS7FlagTable const* extraTable, cmVisualStudio10TargetGenerator* g)
  34. : cmIDEOptions()
  35. , LocalGenerator(lg)
  36. , Version(lg->GetVersion())
  37. , CurrentTool(tool)
  38. , TargetGenerator(g)
  39. {
  40. // Store the given flag tables.
  41. this->AddTable(table);
  42. this->AddTable(extraTable);
  43. // Preprocessor definitions are not allowed for linker tools.
  44. this->AllowDefine = (tool != Linker);
  45. // include directories are not allowed for linker tools.
  46. this->AllowInclude = (tool != Linker);
  47. // Slash options are allowed for VS.
  48. this->AllowSlash = true;
  49. this->FortranRuntimeDebug = false;
  50. this->FortranRuntimeDLL = false;
  51. this->FortranRuntimeMT = false;
  52. this->UnknownFlagField = "AdditionalOptions";
  53. }
  54. void cmVisualStudioGeneratorOptions::AddTable(cmVS7FlagTable const* table)
  55. {
  56. if (table) {
  57. for (int i = 0; i < FlagTableCount; ++i) {
  58. if (!this->FlagTable[i]) {
  59. this->FlagTable[i] = table;
  60. break;
  61. }
  62. }
  63. }
  64. }
  65. void cmVisualStudioGeneratorOptions::ClearTables()
  66. {
  67. for (int i = 0; i < FlagTableCount; ++i) {
  68. this->FlagTable[i] = nullptr;
  69. }
  70. }
  71. void cmVisualStudioGeneratorOptions::FixExceptionHandlingDefault()
  72. {
  73. // Exception handling is on by default because the platform file has
  74. // "/EHsc" in the flags. Normally, that will override this
  75. // initialization to off, but the user has the option of removing
  76. // the flag to disable exception handling. When the user does
  77. // remove the flag we need to override the IDE default of on.
  78. switch (this->Version) {
  79. case cmGlobalVisualStudioGenerator::VS10:
  80. case cmGlobalVisualStudioGenerator::VS11:
  81. case cmGlobalVisualStudioGenerator::VS12:
  82. case cmGlobalVisualStudioGenerator::VS14:
  83. case cmGlobalVisualStudioGenerator::VS15:
  84. // by default VS puts <ExceptionHandling></ExceptionHandling> empty
  85. // for a project, to make our projects look the same put a new line
  86. // and space over for the closing </ExceptionHandling> as the default
  87. // value
  88. this->FlagMap["ExceptionHandling"] = "\n ";
  89. break;
  90. default:
  91. this->FlagMap["ExceptionHandling"] = "0";
  92. break;
  93. }
  94. }
  95. void cmVisualStudioGeneratorOptions::SetVerboseMakefile(bool verbose)
  96. {
  97. // If verbose makefiles have been requested and the /nologo option
  98. // was not given explicitly in the flags we want to add an attribute
  99. // to the generated project to disable logo suppression. Otherwise
  100. // the GUI default is to enable suppression.
  101. //
  102. // On Visual Studio 10 (and later!), the value of this attribute should be
  103. // an empty string, instead of "FALSE", in order to avoid a warning:
  104. // "cl ... warning D9035: option 'nologo-' has been deprecated"
  105. //
  106. if (verbose &&
  107. this->FlagMap.find("SuppressStartupBanner") == this->FlagMap.end()) {
  108. this->FlagMap["SuppressStartupBanner"] =
  109. this->Version < cmGlobalVisualStudioGenerator::VS10 ? "FALSE" : "";
  110. }
  111. }
  112. bool cmVisualStudioGeneratorOptions::IsDebug() const
  113. {
  114. if (this->CurrentTool != CSharpCompiler) {
  115. return this->FlagMap.find("DebugInformationFormat") != this->FlagMap.end();
  116. }
  117. std::map<std::string, FlagValue>::const_iterator i =
  118. this->FlagMap.find("DebugType");
  119. if (i != this->FlagMap.end()) {
  120. if (i->second.size() == 1) {
  121. return i->second[0] != "none";
  122. }
  123. }
  124. return false;
  125. }
  126. bool cmVisualStudioGeneratorOptions::IsWinRt() const
  127. {
  128. return this->FlagMap.find("CompileAsWinRT") != this->FlagMap.end();
  129. }
  130. bool cmVisualStudioGeneratorOptions::IsManaged() const
  131. {
  132. return this->FlagMap.find("CompileAsManaged") != this->FlagMap.end();
  133. }
  134. bool cmVisualStudioGeneratorOptions::UsingUnicode() const
  135. {
  136. // Look for the a _UNICODE definition.
  137. for (std::vector<std::string>::const_iterator di = this->Defines.begin();
  138. di != this->Defines.end(); ++di) {
  139. if (*di == "_UNICODE") {
  140. return true;
  141. }
  142. }
  143. return false;
  144. }
  145. bool cmVisualStudioGeneratorOptions::UsingSBCS() const
  146. {
  147. // Look for the a _SBCS definition.
  148. for (std::vector<std::string>::const_iterator di = this->Defines.begin();
  149. di != this->Defines.end(); ++di) {
  150. if (*di == "_SBCS") {
  151. return true;
  152. }
  153. }
  154. return false;
  155. }
  156. cmVisualStudioGeneratorOptions::CudaRuntime
  157. cmVisualStudioGeneratorOptions::GetCudaRuntime() const
  158. {
  159. std::map<std::string, FlagValue>::const_iterator i =
  160. this->FlagMap.find("CudaRuntime");
  161. if (i != this->FlagMap.end() && i->second.size() == 1) {
  162. std::string const& cudaRuntime = i->second[0];
  163. if (cudaRuntime == "Static") {
  164. return CudaRuntimeStatic;
  165. }
  166. if (cudaRuntime == "Shared") {
  167. return CudaRuntimeShared;
  168. }
  169. if (cudaRuntime == "None") {
  170. return CudaRuntimeNone;
  171. }
  172. }
  173. // nvcc default is static
  174. return CudaRuntimeStatic;
  175. }
  176. void cmVisualStudioGeneratorOptions::FixCudaCodeGeneration()
  177. {
  178. // Extract temporary values stored by our flag table.
  179. FlagValue arch = this->TakeFlag("cmake-temp-arch");
  180. FlagValue code = this->TakeFlag("cmake-temp-code");
  181. FlagValue gencode = this->TakeFlag("cmake-temp-gencode");
  182. // No -code allowed without -arch.
  183. if (arch.empty()) {
  184. code.clear();
  185. }
  186. if (arch.empty() && gencode.empty()) {
  187. return;
  188. }
  189. // Create a CodeGeneration field with [arch],[code] syntax in each entry.
  190. // CUDA will convert it to `-gencode=arch=[arch],code="[code],[arch]"`.
  191. FlagValue& result = this->FlagMap["CodeGeneration"];
  192. // First entries for the -arch=<arch> [-code=<code>,...] pair.
  193. if (!arch.empty()) {
  194. std::string arch_name = arch[0];
  195. std::vector<std::string> codes;
  196. if (!code.empty()) {
  197. codes = cmSystemTools::tokenize(code[0], ",");
  198. }
  199. if (codes.empty()) {
  200. codes.push_back(arch_name);
  201. // nvcc -arch=<arch> has a special case that allows a real
  202. // architecture to be specified instead of a virtual arch.
  203. // It translates to -arch=<virtual> -code=<real>.
  204. cmSystemTools::ReplaceString(arch_name, "sm_", "compute_");
  205. }
  206. for (auto const& c : codes) {
  207. std::string entry = arch_name + "," + c;
  208. result.push_back(entry);
  209. }
  210. }
  211. // Now add entries for the following signatures:
  212. // -gencode=<arch>,<code>
  213. // -gencode=<arch>,[<code1>,<code2>]
  214. // -gencode=<arch>,"<code1>,<code2>"
  215. for (auto const& e : gencode) {
  216. std::string entry = e;
  217. cmSystemTools::ReplaceString(entry, "arch=", "");
  218. cmSystemTools::ReplaceString(entry, "code=", "");
  219. cmSystemTools::ReplaceString(entry, "[", "");
  220. cmSystemTools::ReplaceString(entry, "]", "");
  221. cmSystemTools::ReplaceString(entry, "\"", "");
  222. std::vector<std::string> codes = cmSystemTools::tokenize(entry, ",");
  223. if (codes.size() >= 2) {
  224. auto gencode_arch = cm::cbegin(codes);
  225. for (auto ci = gencode_arch + 1; ci != cm::cend(codes); ++ci) {
  226. std::string code_entry = *gencode_arch + "," + *ci;
  227. result.push_back(code_entry);
  228. }
  229. }
  230. }
  231. }
  232. void cmVisualStudioGeneratorOptions::FixManifestUACFlags()
  233. {
  234. static std::string const ENABLE_UAC = "EnableUAC";
  235. if (!HasFlag(ENABLE_UAC)) {
  236. return;
  237. }
  238. const std::string uacFlag = GetFlag(ENABLE_UAC);
  239. std::vector<std::string> subOptions;
  240. cmsys::SystemTools::Split(uacFlag, subOptions, ' ');
  241. if (subOptions.empty()) {
  242. AddFlag(ENABLE_UAC, "true");
  243. return;
  244. }
  245. if (subOptions.size() == 1 && subOptions[0] == "NO") {
  246. AddFlag(ENABLE_UAC, "false");
  247. return;
  248. }
  249. std::map<std::string, std::string> uacMap;
  250. uacMap["level"] = "UACExecutionLevel";
  251. uacMap["uiAccess"] = "UACUIAccess";
  252. std::map<std::string, std::string> uacExecuteLevelMap;
  253. uacExecuteLevelMap["asInvoker"] = "AsInvoker";
  254. uacExecuteLevelMap["highestAvailable"] = "HighestAvailable";
  255. uacExecuteLevelMap["requireAdministrator"] = "RequireAdministrator";
  256. for (auto const& subopt : subOptions) {
  257. std::vector<std::string> keyValue;
  258. cmsys::SystemTools::Split(subopt, keyValue, '=');
  259. if (keyValue.size() != 2 || (uacMap.find(keyValue[0]) == uacMap.end())) {
  260. // ignore none key=value option or unknown flags
  261. continue;
  262. }
  263. if (keyValue[1].front() == '\'' && keyValue[1].back() == '\'') {
  264. keyValue[1] =
  265. keyValue[1].substr(1, std::max<int>(0, keyValue[1].size() - 2));
  266. }
  267. if (keyValue[0] == "level") {
  268. if (uacExecuteLevelMap.find(keyValue[1]) == uacExecuteLevelMap.end()) {
  269. // unknown level value
  270. continue;
  271. }
  272. AddFlag(uacMap[keyValue[0]], uacExecuteLevelMap[keyValue[1]]);
  273. continue;
  274. }
  275. if (keyValue[0] == "uiAccess") {
  276. if (keyValue[1] != "true" && keyValue[1] != "false") {
  277. // unknown uiAccess value
  278. continue;
  279. }
  280. AddFlag(uacMap[keyValue[0]], keyValue[1]);
  281. continue;
  282. }
  283. // unknown sub option
  284. }
  285. AddFlag(ENABLE_UAC, "true");
  286. }
  287. void cmVisualStudioGeneratorOptions::Parse(const char* flags)
  288. {
  289. // Parse the input string as a windows command line since the string
  290. // is intended for writing directly into the build files.
  291. std::vector<std::string> args;
  292. cmSystemTools::ParseWindowsCommandLine(flags, args);
  293. // Process flags that need to be represented specially in the IDE
  294. // project file.
  295. for (std::vector<std::string>::iterator ai = args.begin(); ai != args.end();
  296. ++ai) {
  297. this->HandleFlag(ai->c_str());
  298. }
  299. }
  300. void cmVisualStudioGeneratorOptions::ParseFinish()
  301. {
  302. if (this->CurrentTool == FortranCompiler) {
  303. // "RuntimeLibrary" attribute values:
  304. // "rtMultiThreaded", "0", /threads /libs:static
  305. // "rtMultiThreadedDLL", "2", /threads /libs:dll
  306. // "rtMultiThreadedDebug", "1", /threads /dbglibs /libs:static
  307. // "rtMultiThreadedDebugDLL", "3", /threads /dbglibs /libs:dll
  308. // These seem unimplemented by the IDE:
  309. // "rtSingleThreaded", "4", /libs:static
  310. // "rtSingleThreadedDLL", "10", /libs:dll
  311. // "rtSingleThreadedDebug", "5", /dbglibs /libs:static
  312. // "rtSingleThreadedDebugDLL", "11", /dbglibs /libs:dll
  313. std::string rl = "rtMultiThreaded";
  314. rl += this->FortranRuntimeDebug ? "Debug" : "";
  315. rl += this->FortranRuntimeDLL ? "DLL" : "";
  316. this->FlagMap["RuntimeLibrary"] = rl;
  317. }
  318. if (this->CurrentTool == CudaCompiler) {
  319. std::map<std::string, FlagValue>::iterator i =
  320. this->FlagMap.find("CudaRuntime");
  321. if (i != this->FlagMap.end() && i->second.size() == 1) {
  322. std::string& cudaRuntime = i->second[0];
  323. if (cudaRuntime == "static") {
  324. cudaRuntime = "Static";
  325. } else if (cudaRuntime == "shared") {
  326. cudaRuntime = "Shared";
  327. } else if (cudaRuntime == "none") {
  328. cudaRuntime = "None";
  329. }
  330. }
  331. }
  332. }
  333. void cmVisualStudioGeneratorOptions::PrependInheritedString(
  334. std::string const& key)
  335. {
  336. std::map<std::string, FlagValue>::iterator i = this->FlagMap.find(key);
  337. if (i == this->FlagMap.end() || i->second.size() != 1) {
  338. return;
  339. }
  340. std::string& value = i->second[0];
  341. value = "%(" + key + ") " + value;
  342. }
  343. void cmVisualStudioGeneratorOptions::Reparse(std::string const& key)
  344. {
  345. std::map<std::string, FlagValue>::iterator i = this->FlagMap.find(key);
  346. if (i == this->FlagMap.end() || i->second.size() != 1) {
  347. return;
  348. }
  349. std::string const original = i->second[0];
  350. i->second[0] = "";
  351. this->UnknownFlagField = key;
  352. this->Parse(original.c_str());
  353. }
  354. void cmVisualStudioGeneratorOptions::StoreUnknownFlag(const char* flag)
  355. {
  356. // Look for Intel Fortran flags that do not map well in the flag table.
  357. if (this->CurrentTool == FortranCompiler) {
  358. if (strcmp(flag, "/dbglibs") == 0) {
  359. this->FortranRuntimeDebug = true;
  360. return;
  361. }
  362. if (strcmp(flag, "/threads") == 0) {
  363. this->FortranRuntimeMT = true;
  364. return;
  365. }
  366. if (strcmp(flag, "/libs:dll") == 0) {
  367. this->FortranRuntimeDLL = true;
  368. return;
  369. }
  370. if (strcmp(flag, "/libs:static") == 0) {
  371. this->FortranRuntimeDLL = false;
  372. return;
  373. }
  374. }
  375. // This option is not known. Store it in the output flags.
  376. std::string const opts = cmOutputConverter::EscapeWindowsShellArgument(
  377. flag, cmOutputConverter::Shell_Flag_AllowMakeVariables |
  378. cmOutputConverter::Shell_Flag_VSIDE);
  379. this->AppendFlagString(this->UnknownFlagField, opts);
  380. }
  381. cmIDEOptions::FlagValue cmVisualStudioGeneratorOptions::TakeFlag(
  382. std::string const& key)
  383. {
  384. FlagValue value;
  385. std::map<std::string, FlagValue>::iterator i = this->FlagMap.find(key);
  386. if (i != this->FlagMap.end()) {
  387. value = i->second;
  388. this->FlagMap.erase(i);
  389. }
  390. return value;
  391. }
  392. void cmVisualStudioGeneratorOptions::SetConfiguration(const char* config)
  393. {
  394. this->Configuration = config;
  395. }
  396. void cmVisualStudioGeneratorOptions::OutputPreprocessorDefinitions(
  397. std::ostream& fout, const char* prefix, const char* suffix,
  398. const std::string& lang)
  399. {
  400. if (this->Defines.empty()) {
  401. return;
  402. }
  403. const char* tag = "PreprocessorDefinitions";
  404. if (lang == "CUDA") {
  405. tag = "Defines";
  406. }
  407. if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
  408. // if there are configuration specific flags, then
  409. // use the configuration specific tag for PreprocessorDefinitions
  410. if (!this->Configuration.empty()) {
  411. fout << prefix;
  412. this->TargetGenerator->WritePlatformConfigTag(
  413. tag, this->Configuration.c_str(), 0, 0, 0, &fout);
  414. } else {
  415. fout << prefix << "<" << tag << ">";
  416. }
  417. } else {
  418. fout << prefix << tag << "=\"";
  419. }
  420. const char* sep = "";
  421. std::vector<std::string>::const_iterator de =
  422. cmRemoveDuplicates(this->Defines);
  423. for (std::vector<std::string>::const_iterator di = this->Defines.begin();
  424. di != de; ++di) {
  425. // Escape the definition for the compiler.
  426. std::string define;
  427. if (this->Version < cmGlobalVisualStudioGenerator::VS10) {
  428. define = this->LocalGenerator->EscapeForShell(di->c_str(), true);
  429. } else {
  430. define = *di;
  431. }
  432. // Escape this flag for the IDE.
  433. if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
  434. define = cmVisualStudio10GeneratorOptionsEscapeForXML(define);
  435. if (lang == "RC") {
  436. cmSystemTools::ReplaceString(define, "\"", "\\\"");
  437. }
  438. } else {
  439. define = cmVisualStudioGeneratorOptionsEscapeForXML(define);
  440. }
  441. // Store the flag in the project file.
  442. fout << sep << define;
  443. sep = ";";
  444. }
  445. if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
  446. fout << ";%(" << tag << ")</" << tag << ">" << suffix;
  447. } else {
  448. fout << "\"" << suffix;
  449. }
  450. }
  451. void cmVisualStudioGeneratorOptions::OutputAdditionalIncludeDirectories(
  452. std::ostream& fout, const char* prefix, const char* suffix,
  453. const std::string& lang)
  454. {
  455. if (this->Includes.empty()) {
  456. return;
  457. }
  458. const char* tag = "AdditionalIncludeDirectories";
  459. if (lang == "CUDA") {
  460. tag = "Include";
  461. } else if (lang == "ASM_MASM" || lang == "ASM_NASM") {
  462. tag = "IncludePaths";
  463. }
  464. if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
  465. // if there are configuration specific flags, then
  466. // use the configuration specific tag for PreprocessorDefinitions
  467. if (!this->Configuration.empty()) {
  468. fout << prefix;
  469. this->TargetGenerator->WritePlatformConfigTag(
  470. tag, this->Configuration.c_str(), 0, 0, 0, &fout);
  471. } else {
  472. fout << prefix << "<" << tag << ">";
  473. }
  474. } else {
  475. fout << prefix << tag << "=\"";
  476. }
  477. const char* sep = "";
  478. for (std::string include : this->Includes) {
  479. // first convert all of the slashes
  480. std::string::size_type pos = 0;
  481. while ((pos = include.find('/', pos)) != std::string::npos) {
  482. include[pos] = '\\';
  483. pos++;
  484. }
  485. if (lang == "ASM_NASM") {
  486. include += "\\";
  487. }
  488. // Escape this include for the IDE.
  489. fout << sep << (this->Version >= cmGlobalVisualStudioGenerator::VS10
  490. ? cmVisualStudio10GeneratorOptionsEscapeForXML(include)
  491. : cmVisualStudioGeneratorOptionsEscapeForXML(include));
  492. sep = ";";
  493. if (lang == "Fortran") {
  494. include += "/$(ConfigurationName)";
  495. fout << sep << (this->Version >= cmGlobalVisualStudioGenerator::VS10
  496. ? cmVisualStudio10GeneratorOptionsEscapeForXML(include)
  497. : cmVisualStudioGeneratorOptionsEscapeForXML(include));
  498. }
  499. }
  500. if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
  501. fout << sep << "%(" << tag << ")</" << tag << ">" << suffix;
  502. } else {
  503. fout << "\"" << suffix;
  504. }
  505. }
  506. void cmVisualStudioGeneratorOptions::OutputFlagMap(std::ostream& fout,
  507. const char* indent)
  508. {
  509. if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
  510. for (std::map<std::string, FlagValue>::iterator m = this->FlagMap.begin();
  511. m != this->FlagMap.end(); ++m) {
  512. fout << indent;
  513. if (!this->Configuration.empty()) {
  514. this->TargetGenerator->WritePlatformConfigTag(
  515. m->first.c_str(), this->Configuration.c_str(), 0, 0, 0, &fout);
  516. } else {
  517. fout << "<" << m->first << ">";
  518. }
  519. const char* sep = "";
  520. for (std::vector<std::string>::iterator i = m->second.begin();
  521. i != m->second.end(); ++i) {
  522. fout << sep << cmVisualStudio10GeneratorOptionsEscapeForXML(*i);
  523. sep = ";";
  524. }
  525. fout << "</" << m->first << ">\n";
  526. }
  527. } else {
  528. for (std::map<std::string, FlagValue>::iterator m = this->FlagMap.begin();
  529. m != this->FlagMap.end(); ++m) {
  530. fout << indent << m->first << "=\"";
  531. const char* sep = "";
  532. for (std::vector<std::string>::iterator i = m->second.begin();
  533. i != m->second.end(); ++i) {
  534. fout << sep << cmVisualStudioGeneratorOptionsEscapeForXML(*i);
  535. sep = ";";
  536. }
  537. fout << "\"\n";
  538. }
  539. }
  540. }