cmGlobalVisualStudio8Generator.cxx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  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 "cmGlobalVisualStudio8Generator.h"
  4. #include <algorithm>
  5. #include <functional>
  6. #include <ostream>
  7. #include <utility>
  8. #include <cm/memory>
  9. #include <cmext/algorithm>
  10. #include <cmext/memory>
  11. #include "cmCustomCommand.h"
  12. #include "cmCustomCommandLines.h"
  13. #include "cmCustomCommandTypes.h"
  14. #include "cmGeneratedFileStream.h"
  15. #include "cmGeneratorExpression.h"
  16. #include "cmGeneratorTarget.h"
  17. #include "cmGlobalGenerator.h"
  18. #include "cmGlobalVisualStudio7Generator.h"
  19. #include "cmGlobalVisualStudioGenerator.h"
  20. #include "cmList.h"
  21. #include "cmListFileCache.h"
  22. #include "cmLocalGenerator.h"
  23. #include "cmLocalVisualStudio7Generator.h"
  24. #include "cmMakefile.h"
  25. #include "cmPolicies.h"
  26. #include "cmSourceFile.h"
  27. #include "cmStateTypes.h"
  28. #include "cmStringAlgorithms.h"
  29. #include "cmSystemTools.h"
  30. #include "cmTarget.h"
  31. #include "cmTargetDepend.h"
  32. #include "cmValue.h"
  33. #include "cmVisualStudioGeneratorOptions.h"
  34. #include "cmake.h"
  35. struct cmIDEFlagTable;
  36. cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator(
  37. cmake* cm, const std::string& name,
  38. std::string const& platformInGeneratorName)
  39. : cmGlobalVisualStudio71Generator(cm, platformInGeneratorName)
  40. {
  41. this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms";
  42. this->Name = name;
  43. this->ExtraFlagTable =
  44. cmGlobalVisualStudio8Generator::GetExtraFlagTableVS8();
  45. }
  46. std::string cmGlobalVisualStudio8Generator::FindDevEnvCommand()
  47. {
  48. // First look for VCExpress.
  49. std::string vsxcmd;
  50. std::string vsxkey =
  51. cmStrCat(R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\)",
  52. this->GetIDEVersion(), ";InstallDir");
  53. if (cmSystemTools::ReadRegistryValue(vsxkey, vsxcmd,
  54. cmSystemTools::KeyWOW64_32)) {
  55. cmSystemTools::ConvertToUnixSlashes(vsxcmd);
  56. vsxcmd += "/VCExpress.exe";
  57. return vsxcmd;
  58. }
  59. // Now look for devenv.
  60. return this->cmGlobalVisualStudio71Generator::FindDevEnvCommand();
  61. }
  62. void cmGlobalVisualStudio8Generator::EnableLanguage(
  63. std::vector<std::string> const& lang, cmMakefile* mf, bool optional)
  64. {
  65. for (std::string const& it : lang) {
  66. if (it == "ASM_MASM") {
  67. this->MasmEnabled = true;
  68. }
  69. }
  70. this->AddPlatformDefinitions(mf);
  71. cmGlobalVisualStudio7Generator::EnableLanguage(lang, mf, optional);
  72. }
  73. void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf)
  74. {
  75. if (this->TargetsWindowsCE()) {
  76. mf->AddDefinition("CMAKE_VS_WINCE_VERSION", this->WindowsCEVersion);
  77. }
  78. }
  79. bool cmGlobalVisualStudio8Generator::SetGeneratorPlatform(std::string const& p,
  80. cmMakefile* mf)
  81. {
  82. if (this->PlatformInGeneratorName) {
  83. // This is an old-style generator name that contains the platform name.
  84. // No explicit platform specification is supported, so pass it through
  85. // to our base class implementation, which errors on non-empty platforms.
  86. return this->cmGlobalVisualStudio7Generator::SetGeneratorPlatform(p, mf);
  87. }
  88. if (!this->ParseGeneratorPlatform(p, mf)) {
  89. return false;
  90. }
  91. // FIXME: Add CMAKE_GENERATOR_PLATFORM field to set the framework.
  92. // For now, just report the generator's default, if any.
  93. if (cm::optional<std::string> const& targetFrameworkVersion =
  94. this->GetTargetFrameworkVersion()) {
  95. mf->AddDefinition("CMAKE_VS_TARGET_FRAMEWORK_VERSION",
  96. *targetFrameworkVersion);
  97. }
  98. if (cm::optional<std::string> const& targetFrameworkIdentifier =
  99. this->GetTargetFrameworkIdentifier()) {
  100. mf->AddDefinition("CMAKE_VS_TARGET_FRAMEWORK_IDENTIFIER",
  101. *targetFrameworkIdentifier);
  102. }
  103. if (cm::optional<std::string> const& targetFrameworkTargetsVersion =
  104. this->GetTargetFrameworkTargetsVersion()) {
  105. mf->AddDefinition("CMAKE_VS_TARGET_FRAMEWORK_TARGETS_VERSION",
  106. *targetFrameworkTargetsVersion);
  107. }
  108. // The generator name does not contain the platform name, and so supports
  109. // explicit platform specification. We handled that above, so pass an
  110. // empty platform name to our base class implementation so it does not error.
  111. return this->cmGlobalVisualStudio7Generator::SetGeneratorPlatform("", mf);
  112. }
  113. bool cmGlobalVisualStudio8Generator::ParseGeneratorPlatform(
  114. std::string const& p, cmMakefile* mf)
  115. {
  116. this->GeneratorPlatform.clear();
  117. std::vector<std::string> const fields = cmTokenize(p, ",");
  118. auto fi = fields.begin();
  119. if (fi == fields.end()) {
  120. return true;
  121. }
  122. // The first field may be the VS platform.
  123. if (fi->find('=') == fi->npos) {
  124. this->GeneratorPlatform = *fi;
  125. ++fi;
  126. }
  127. std::set<std::string> handled;
  128. // The rest of the fields must be key=value pairs.
  129. for (; fi != fields.end(); ++fi) {
  130. std::string::size_type pos = fi->find('=');
  131. if (pos == fi->npos) {
  132. std::ostringstream e;
  133. /* clang-format off */
  134. e <<
  135. "Generator\n"
  136. " " << this->GetName() << "\n"
  137. "given platform specification\n"
  138. " " << p << "\n"
  139. "that contains a field after the first ',' with no '='."
  140. ;
  141. /* clang-format on */
  142. mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
  143. return false;
  144. }
  145. std::string const key = fi->substr(0, pos);
  146. std::string const value = fi->substr(pos + 1);
  147. if (!handled.insert(key).second) {
  148. std::ostringstream e;
  149. /* clang-format off */
  150. e <<
  151. "Generator\n"
  152. " " << this->GetName() << "\n"
  153. "given platform specification\n"
  154. " " << p << "\n"
  155. "that contains duplicate field key '" << key << "'."
  156. ;
  157. /* clang-format on */
  158. mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
  159. return false;
  160. }
  161. if (!this->ProcessGeneratorPlatformField(key, value)) {
  162. std::ostringstream e;
  163. /* clang-format off */
  164. e <<
  165. "Generator\n"
  166. " " << this->GetName() << "\n"
  167. "given platform specification\n"
  168. " " << p << "\n"
  169. "that contains invalid field '" << *fi << "'."
  170. ;
  171. /* clang-format on */
  172. mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
  173. return false;
  174. }
  175. }
  176. return true;
  177. }
  178. bool cmGlobalVisualStudio8Generator::ProcessGeneratorPlatformField(
  179. std::string const& key, std::string const& value)
  180. {
  181. static_cast<void>(key);
  182. static_cast<void>(value);
  183. return false;
  184. }
  185. cm::optional<std::string> const&
  186. cmGlobalVisualStudio8Generator::GetTargetFrameworkVersion() const
  187. {
  188. return this->DefaultTargetFrameworkVersion;
  189. }
  190. cm::optional<std::string> const&
  191. cmGlobalVisualStudio8Generator::GetTargetFrameworkIdentifier() const
  192. {
  193. return this->DefaultTargetFrameworkIdentifier;
  194. }
  195. cm::optional<std::string> const&
  196. cmGlobalVisualStudio8Generator::GetTargetFrameworkTargetsVersion() const
  197. {
  198. return this->DefaultTargetFrameworkTargetsVersion;
  199. }
  200. std::string cmGlobalVisualStudio8Generator::GetGenerateStampList()
  201. {
  202. return "generate.stamp.list";
  203. }
  204. void cmGlobalVisualStudio8Generator::Configure()
  205. {
  206. this->cmGlobalVisualStudio7Generator::Configure();
  207. }
  208. bool cmGlobalVisualStudio8Generator::UseFolderProperty() const
  209. {
  210. // NOLINTNEXTLINE(bugprone-parent-virtual-call)
  211. return IsExpressEdition() ? false : cmGlobalGenerator::UseFolderProperty();
  212. }
  213. bool cmGlobalVisualStudio8Generator::AddCheckTarget()
  214. {
  215. // Add a special target on which all other targets depend that
  216. // checks the build system and optionally re-runs CMake.
  217. // Skip the target if no regeneration is to be done.
  218. if (this->GlobalSettingIsOn("CMAKE_SUPPRESS_REGENERATION")) {
  219. return false;
  220. }
  221. std::vector<std::unique_ptr<cmLocalGenerator>> const& generators =
  222. this->LocalGenerators;
  223. auto& lg =
  224. cm::static_reference_cast<cmLocalVisualStudio7Generator>(generators[0]);
  225. auto cc = cm::make_unique<cmCustomCommand>();
  226. cmTarget* tgt = lg.AddUtilityCommand(CMAKE_CHECK_BUILD_SYSTEM_TARGET, false,
  227. std::move(cc));
  228. // Collect the input files used to generate all targets in this
  229. // project.
  230. std::vector<std::string> listFiles;
  231. for (const auto& gen : generators) {
  232. cm::append(listFiles, gen->GetMakefile()->GetListFiles());
  233. }
  234. // Sort the list of input files and remove duplicates.
  235. std::sort(listFiles.begin(), listFiles.end(), std::less<std::string>());
  236. auto new_end = std::unique(listFiles.begin(), listFiles.end());
  237. listFiles.erase(new_end, listFiles.end());
  238. // Add all cmake input files which are used by the project
  239. // so Visual Studio does not close them when reloading it.
  240. for (const std::string& listFile : listFiles) {
  241. if (listFile.find("/CMakeFiles/") != std::string::npos) {
  242. continue;
  243. }
  244. if (!cmSystemTools::IsSubDirectory(listFile,
  245. lg.GetMakefile()->GetHomeDirectory()) &&
  246. !cmSystemTools::IsSubDirectory(
  247. listFile, lg.GetMakefile()->GetHomeOutputDirectory())) {
  248. continue;
  249. }
  250. tgt->AddSource(listFile);
  251. }
  252. auto ptr = cm::make_unique<cmGeneratorTarget>(tgt, &lg);
  253. auto* gt = ptr.get();
  254. lg.AddGeneratorTarget(std::move(ptr));
  255. // Organize in the "predefined targets" folder:
  256. //
  257. if (this->UseFolderProperty()) {
  258. tgt->SetProperty("FOLDER", this->GetPredefinedTargetsFolder());
  259. }
  260. // Create a list of all stamp files for this project.
  261. std::vector<std::string> stamps;
  262. std::string stampList = cmStrCat(
  263. "CMakeFiles/", cmGlobalVisualStudio8Generator::GetGenerateStampList());
  264. {
  265. std::string stampListFile =
  266. cmStrCat(generators[0]->GetMakefile()->GetCurrentBinaryDirectory(), '/',
  267. stampList);
  268. std::string stampFile;
  269. cmGeneratedFileStream fout(stampListFile);
  270. for (const auto& gi : generators) {
  271. stampFile = cmStrCat(gi->GetMakefile()->GetCurrentBinaryDirectory(),
  272. "/CMakeFiles/generate.stamp");
  273. fout << stampFile << "\n";
  274. stamps.push_back(stampFile);
  275. }
  276. }
  277. // Add a custom rule to re-run CMake if any input files changed.
  278. {
  279. // The custom rule runs cmake so set UTF-8 pipes.
  280. bool stdPipesUTF8 = true;
  281. // Add a custom prebuild target to run the VerifyGlobs script.
  282. cmake* cm = this->GetCMakeInstance();
  283. if (cm->DoWriteGlobVerifyTarget()) {
  284. cmCustomCommandLines verifyCommandLines = cmMakeSingleCommandLine(
  285. { cmSystemTools::GetCMakeCommand(), "-P", cm->GetGlobVerifyScript() });
  286. std::vector<std::string> byproducts;
  287. byproducts.push_back(cm->GetGlobVerifyStamp());
  288. cc = cm::make_unique<cmCustomCommand>();
  289. cc->SetByproducts(byproducts);
  290. cc->SetCommandLines(verifyCommandLines);
  291. cc->SetComment("Checking File Globs");
  292. cc->SetStdPipesUTF8(stdPipesUTF8);
  293. lg.AddCustomCommandToTarget(CMAKE_CHECK_BUILD_SYSTEM_TARGET,
  294. cmCustomCommandType::PRE_BUILD,
  295. std::move(cc));
  296. // Ensure ZERO_CHECK always runs in Visual Studio using MSBuild,
  297. // otherwise the prebuild command will not be run.
  298. tgt->SetProperty("VS_GLOBAL_DisableFastUpToDateCheck", "true");
  299. listFiles.push_back(cm->GetGlobVerifyStamp());
  300. }
  301. // Create a rule to re-run CMake.
  302. std::string argS = cmStrCat("-S", lg.GetSourceDirectory());
  303. std::string argB = cmStrCat("-B", lg.GetBinaryDirectory());
  304. std::string const sln =
  305. lg.GetBinaryDirectory() + "/" + lg.GetProjectName() + ".sln";
  306. cmCustomCommandLines commandLines = cmMakeSingleCommandLine(
  307. { cmSystemTools::GetCMakeCommand(), argS, argB, "--check-stamp-list",
  308. stampList, "--vs-solution-file", sln });
  309. if (cm->GetIgnoreWarningAsError()) {
  310. commandLines[0].emplace_back("--compile-no-warning-as-error");
  311. }
  312. // Add the rule. Note that we cannot use the CMakeLists.txt
  313. // file as the main dependency because it would get
  314. // overwritten by the CreateVCProjBuildRule.
  315. // (this could be avoided with per-target source files)
  316. cc = cm::make_unique<cmCustomCommand>();
  317. cc->SetOutputs(stamps);
  318. cc->SetDepends(listFiles);
  319. cc->SetCommandLines(commandLines);
  320. cc->SetComment("Checking Build System");
  321. cc->SetEscapeOldStyle(false);
  322. cc->SetStdPipesUTF8(stdPipesUTF8);
  323. if (cmSourceFile* file =
  324. lg.AddCustomCommandToOutput(std::move(cc), true)) {
  325. gt->AddSource(file->ResolveFullPath());
  326. } else {
  327. cmSystemTools::Error("Error adding rule for " + stamps[0]);
  328. }
  329. }
  330. return true;
  331. }
  332. void cmGlobalVisualStudio8Generator::AddExtraIDETargets()
  333. {
  334. cmGlobalVisualStudio7Generator::AddExtraIDETargets();
  335. if (this->AddCheckTarget()) {
  336. for (auto& LocalGenerator : this->LocalGenerators) {
  337. const auto& tgts = LocalGenerator->GetGeneratorTargets();
  338. // All targets depend on the build-system check target.
  339. for (const auto& ti : tgts) {
  340. if (ti->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET) {
  341. ti->Target->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET, false);
  342. }
  343. }
  344. }
  345. }
  346. }
  347. void cmGlobalVisualStudio8Generator::WriteSolutionConfigurations(
  348. std::ostream& fout, std::vector<std::string> const& configs)
  349. {
  350. fout << "\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n";
  351. for (std::string const& i : configs) {
  352. fout << "\t\t" << i << "|" << this->GetPlatformName() << " = " << i << "|"
  353. << this->GetPlatformName() << "\n";
  354. }
  355. fout << "\tEndGlobalSection\n";
  356. }
  357. void cmGlobalVisualStudio8Generator::WriteProjectConfigurations(
  358. std::ostream& fout, const std::string& name, cmGeneratorTarget const& target,
  359. std::vector<std::string> const& configs,
  360. const std::set<std::string>& configsPartOfDefaultBuild,
  361. std::string const& platformMapping)
  362. {
  363. std::string guid = this->GetGUID(name);
  364. for (std::string const& i : configs) {
  365. cmList mapConfig;
  366. const char* dstConfig = i.c_str();
  367. if (target.GetProperty("EXTERNAL_MSPROJECT")) {
  368. if (cmValue m = target.GetProperty("MAP_IMPORTED_CONFIG_" +
  369. cmSystemTools::UpperCase(i))) {
  370. mapConfig.assign(*m);
  371. if (!mapConfig.empty()) {
  372. dstConfig = mapConfig[0].c_str();
  373. }
  374. }
  375. }
  376. fout << "\t\t{" << guid << "}." << i << "|" << this->GetPlatformName()
  377. << ".ActiveCfg = " << dstConfig << "|"
  378. << (!platformMapping.empty() ? platformMapping
  379. : this->GetPlatformName())
  380. << "\n";
  381. auto ci = configsPartOfDefaultBuild.find(i);
  382. if (!(ci == configsPartOfDefaultBuild.end())) {
  383. fout << "\t\t{" << guid << "}." << i << "|" << this->GetPlatformName()
  384. << ".Build.0 = " << dstConfig << "|"
  385. << (!platformMapping.empty() ? platformMapping
  386. : this->GetPlatformName())
  387. << "\n";
  388. }
  389. if (this->NeedsDeploy(target, dstConfig)) {
  390. fout << "\t\t{" << guid << "}." << i << "|" << this->GetPlatformName()
  391. << ".Deploy.0 = " << dstConfig << "|"
  392. << (!platformMapping.empty() ? platformMapping
  393. : this->GetPlatformName())
  394. << "\n";
  395. }
  396. }
  397. }
  398. bool cmGlobalVisualStudio8Generator::NeedsDeploy(
  399. cmGeneratorTarget const& target, const char* config) const
  400. {
  401. cmStateEnums::TargetType const type = target.GetType();
  402. if (type != cmStateEnums::EXECUTABLE &&
  403. type != cmStateEnums::SHARED_LIBRARY) {
  404. // deployment only valid on executables and shared libraries.
  405. return false;
  406. }
  407. if (cmValue prop = target.GetProperty("VS_SOLUTION_DEPLOY")) {
  408. // If set, it dictates behavior
  409. return cmIsOn(
  410. cmGeneratorExpression::Evaluate(*prop, target.LocalGenerator, config));
  411. }
  412. // To be deprecated, disable deployment even if target supports it.
  413. if (cmValue prop = target.GetProperty("VS_NO_SOLUTION_DEPLOY")) {
  414. if (cmIsOn(cmGeneratorExpression::Evaluate(*prop, target.LocalGenerator,
  415. config))) {
  416. // If true, always disable deployment
  417. return false;
  418. }
  419. }
  420. // Legacy behavior, enabled deployment based on 'hard-coded' target
  421. // platforms.
  422. return this->TargetSystemSupportsDeployment();
  423. }
  424. bool cmGlobalVisualStudio8Generator::TargetSystemSupportsDeployment() const
  425. {
  426. return this->TargetsWindowsCE();
  427. }
  428. bool cmGlobalVisualStudio8Generator::ComputeTargetDepends()
  429. {
  430. // Skip over the cmGlobalVisualStudioGenerator implementation!
  431. // We do not need the support that VS <= 7.1 needs.
  432. // NOLINTNEXTLINE(bugprone-parent-virtual-call)
  433. return this->cmGlobalGenerator::ComputeTargetDepends();
  434. }
  435. void cmGlobalVisualStudio8Generator::WriteProjectDepends(
  436. std::ostream& fout, const std::string&, const std::string&,
  437. cmGeneratorTarget const* gt)
  438. {
  439. TargetDependSet const& unordered = this->GetTargetDirectDepends(gt);
  440. OrderedTargetDependSet depends(unordered, std::string());
  441. for (cmTargetDepend const& i : depends) {
  442. if (!this->IsInSolution(i)) {
  443. continue;
  444. }
  445. std::string guid = this->GetGUID(i->GetName());
  446. fout << "\t\t{" << guid << "} = {" << guid << "}\n";
  447. }
  448. }
  449. bool cmGlobalVisualStudio8Generator::NeedLinkLibraryDependencies(
  450. cmGeneratorTarget* target)
  451. {
  452. // Look for utility dependencies that magically link.
  453. auto const& utilities = target->GetUtilities();
  454. return std::any_of(
  455. utilities.begin(), utilities.end(),
  456. [target](BT<std::pair<std::string, bool>> const& ui) {
  457. if (cmGeneratorTarget* depTarget =
  458. target->GetLocalGenerator()->FindGeneratorTargetToUse(
  459. ui.Value.first)) {
  460. if (depTarget->IsInBuildSystem() &&
  461. depTarget->GetProperty("EXTERNAL_MSPROJECT")) {
  462. // This utility dependency names an external .vcproj target.
  463. // We use LinkLibraryDependencies="true" to link to it without
  464. // predicting the .lib file location or name.
  465. return true;
  466. }
  467. }
  468. return false;
  469. });
  470. }
  471. static cmVS7FlagTable cmVS8ExtraFlagTable[] = {
  472. { "CallingConvention", "Gd", "cdecl", "0", 0 },
  473. { "CallingConvention", "Gr", "fastcall", "1", 0 },
  474. { "CallingConvention", "Gz", "stdcall", "2", 0 },
  475. { "Detect64BitPortabilityProblems", "Wp64",
  476. "Detect 64Bit Portability Problems", "true", 0 },
  477. { "ErrorReporting", "errorReport:prompt", "Report immediately", "1", 0 },
  478. { "ErrorReporting", "errorReport:queue", "Queue for next login", "2", 0 },
  479. // Precompiled header and related options. Note that the
  480. // UsePrecompiledHeader entries are marked as "Continue" so that the
  481. // corresponding PrecompiledHeaderThrough entry can be found.
  482. { "UsePrecompiledHeader", "Yu", "Use Precompiled Header", "2",
  483. cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
  484. { "PrecompiledHeaderThrough", "Yu", "Precompiled Header Name", "",
  485. cmVS7FlagTable::UserValueRequired },
  486. { "UsePrecompiledHeader", "Y-", "Don't use precompiled header", "0", 0 },
  487. // There is no YX option in the VS8 IDE.
  488. // Exception handling mode. If no entries match, it will be FALSE.
  489. { "ExceptionHandling", "GX", "enable c++ exceptions", "1", 0 },
  490. { "ExceptionHandling", "EHsc", "enable c++ exceptions", "1", 0 },
  491. { "ExceptionHandling", "EHa", "enable SEH exceptions", "2", 0 },
  492. { "EnablePREfast", "analyze", "", "true", 0 },
  493. { "EnablePREfast", "analyze-", "", "false", 0 },
  494. // Language options
  495. { "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "wchar_t is a built-in type",
  496. "true", 0 },
  497. { "TreatWChar_tAsBuiltInType", "Zc:wchar_t-",
  498. "wchar_t is not a built-in type", "false", 0 },
  499. { "", "", "", "", 0 }
  500. };
  501. cmIDEFlagTable const* cmGlobalVisualStudio8Generator::GetExtraFlagTableVS8()
  502. {
  503. return cmVS8ExtraFlagTable;
  504. }