cmGhsMultiTargetGenerator.cxx 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2015 Geoffrey Viola <[email protected]>
  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. #include "cmGhsMultiTargetGenerator.h"
  11. #include "cmGlobalGhsMultiGenerator.h"
  12. #include "cmLocalGhsMultiGenerator.h"
  13. #include "cmMakefile.h"
  14. #include "cmTarget.h"
  15. #include "cmGeneratedFileStream.h"
  16. #include "cmSourceFile.h"
  17. #include <assert.h>
  18. #include <cmAlgorithms.h>
  19. std::string const cmGhsMultiTargetGenerator::DDOption("-dynamic");
  20. cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget *target)
  21. : GeneratorTarget(target)
  22. , LocalGenerator(static_cast<cmLocalGhsMultiGenerator *>(
  23. target->GetLocalGenerator()))
  24. , Makefile(target->Target->GetMakefile())
  25. , TargetGroup(DetermineIfTargetGroup(target))
  26. , DynamicDownload(false)
  27. {
  28. this->RelBuildFilePath = this->GetRelBuildFilePath(target);
  29. this->RelOutputFileName =
  30. this->RelBuildFilePath + target->GetName() + ".a";
  31. this->RelBuildFileName = this->RelBuildFilePath;
  32. this->RelBuildFileName += this->GetBuildFileName(target);
  33. std::string absPathToRoot = this->GetAbsPathToRoot(target);
  34. absPathToRoot = this->AddSlashIfNeededToPath(absPathToRoot);
  35. this->AbsBuildFilePath = absPathToRoot + this->RelBuildFilePath;
  36. this->AbsBuildFileName = absPathToRoot + this->RelBuildFileName;
  37. this->AbsOutputFileName = absPathToRoot + this->RelOutputFileName;
  38. }
  39. cmGhsMultiTargetGenerator::~cmGhsMultiTargetGenerator()
  40. {
  41. cmDeleteAll(this->FolderBuildStreams);
  42. }
  43. std::string
  44. cmGhsMultiTargetGenerator::GetRelBuildFilePath(
  45. const cmGeneratorTarget *target)
  46. {
  47. std::string output;
  48. char const *folderProp = target->GetProperty("FOLDER");
  49. output = NULL == folderProp ? "" : folderProp;
  50. cmSystemTools::ConvertToUnixSlashes(output);
  51. if (!output.empty())
  52. {
  53. output += "/";
  54. }
  55. output += target->GetName() + "/";
  56. return output;
  57. }
  58. std::string
  59. cmGhsMultiTargetGenerator::GetAbsPathToRoot(const cmGeneratorTarget *target)
  60. {
  61. return target->GetLocalGenerator()->GetBinaryDirectory();
  62. }
  63. std::string
  64. cmGhsMultiTargetGenerator::GetAbsBuildFilePath(const cmGeneratorTarget *target)
  65. {
  66. std::string output;
  67. output = cmGhsMultiTargetGenerator::GetAbsPathToRoot(target);
  68. output = cmGhsMultiTargetGenerator::AddSlashIfNeededToPath(output);
  69. output += cmGhsMultiTargetGenerator::GetRelBuildFilePath(target);
  70. return output;
  71. }
  72. std::string
  73. cmGhsMultiTargetGenerator::GetRelBuildFileName(const cmGeneratorTarget *target)
  74. {
  75. std::string output;
  76. output = cmGhsMultiTargetGenerator::GetRelBuildFilePath(target);
  77. output = cmGhsMultiTargetGenerator::AddSlashIfNeededToPath(output);
  78. output += cmGhsMultiTargetGenerator::GetBuildFileName(target);
  79. return output;
  80. }
  81. std::string
  82. cmGhsMultiTargetGenerator::GetBuildFileName(const cmGeneratorTarget *target)
  83. {
  84. std::string output;
  85. output = target->GetName();
  86. output += cmGlobalGhsMultiGenerator::FILE_EXTENSION;
  87. return output;
  88. }
  89. std::string
  90. cmGhsMultiTargetGenerator::AddSlashIfNeededToPath(std::string const &input)
  91. {
  92. std::string output(input);
  93. if (!cmHasLiteralSuffix(output, "/"))
  94. {
  95. output += "/";
  96. }
  97. return output;
  98. }
  99. void cmGhsMultiTargetGenerator::Generate()
  100. {
  101. const std::vector<cmSourceFile *> objectSources = this->GetSources();
  102. if (!objectSources.empty() && this->IncludeThisTarget())
  103. {
  104. if (!cmSystemTools::FileExists(this->AbsBuildFilePath.c_str()))
  105. {
  106. cmSystemTools::MakeDirectory(this->AbsBuildFilePath.c_str());
  107. }
  108. cmGlobalGhsMultiGenerator::Open(std::string(""), this->AbsBuildFileName,
  109. &this->FolderBuildStreams);
  110. cmGlobalGhsMultiGenerator::OpenBuildFileStream(
  111. this->GetFolderBuildStreams());
  112. std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
  113. if (0 == config.length())
  114. {
  115. config = "RELEASE";
  116. }
  117. const std::string language(
  118. this->GeneratorTarget->GetLinkerLanguage(config));
  119. config = cmSystemTools::UpperCase(config);
  120. this->DynamicDownload = this->DetermineIfDynamicDownload(config, language);
  121. if (this->DynamicDownload)
  122. {
  123. *this->GetFolderBuildStreams() << "#component integrity_dynamic_download"
  124. << std::endl;
  125. }
  126. GhsMultiGpj::WriteGpjTag(this->GetGpjTag(), this->GetFolderBuildStreams());
  127. cmGlobalGhsMultiGenerator::WriteDisclaimer(this->GetFolderBuildStreams());
  128. bool const notKernel = this->IsNotKernel(config, language);
  129. this->WriteTypeSpecifics(config, notKernel);
  130. this->SetCompilerFlags(config, language, notKernel);
  131. this->WriteCompilerFlags(config, language);
  132. this->WriteCompilerDefinitions(config, language);
  133. this->WriteIncludes(config, language);
  134. if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
  135. {
  136. this->WriteTargetLinkLibraries();
  137. }
  138. this->WriteCustomCommands();
  139. this->WriteSources(objectSources);
  140. }
  141. }
  142. bool cmGhsMultiTargetGenerator::IncludeThisTarget()
  143. {
  144. bool output = true;
  145. char const *excludeFromAll =
  146. this->GeneratorTarget->GetProperty("EXCLUDE_FROM_ALL");
  147. if (NULL != excludeFromAll && '1' == excludeFromAll[0] &&
  148. '\0' == excludeFromAll[1])
  149. {
  150. output = false;
  151. }
  152. return output;
  153. }
  154. std::vector<cmSourceFile *> cmGhsMultiTargetGenerator::GetSources() const
  155. {
  156. std::vector<cmSourceFile *> output;
  157. std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
  158. this->GeneratorTarget->GetSourceFiles(output, config);
  159. return output;
  160. }
  161. GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag() const
  162. {
  163. return cmGhsMultiTargetGenerator::GetGpjTag(this->GeneratorTarget);
  164. }
  165. GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag(
  166. const cmGeneratorTarget *target)
  167. {
  168. GhsMultiGpj::Types output;
  169. if (cmGhsMultiTargetGenerator::DetermineIfTargetGroup(target))
  170. {
  171. output = GhsMultiGpj::INTERGRITY_APPLICATION;
  172. }
  173. else if (target->GetType() == cmState::STATIC_LIBRARY)
  174. {
  175. output = GhsMultiGpj::LIBRARY;
  176. }
  177. else
  178. {
  179. output = GhsMultiGpj::PROGRAM;
  180. }
  181. return output;
  182. }
  183. cmGlobalGhsMultiGenerator*
  184. cmGhsMultiTargetGenerator::GetGlobalGenerator() const
  185. {
  186. return static_cast<cmGlobalGhsMultiGenerator *>(
  187. this->LocalGenerator->GetGlobalGenerator());
  188. }
  189. void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string &config,
  190. bool const notKernel)
  191. {
  192. std::string outputDir(this->GetOutputDirectory(config));
  193. std::string outputFilename(this->GetOutputFilename(config));
  194. if (this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY)
  195. {
  196. *this->GetFolderBuildStreams() << " -o \""
  197. << outputDir << outputFilename << ".a\""
  198. << std::endl;
  199. }
  200. else if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
  201. {
  202. if (notKernel && !this->IsTargetGroup())
  203. {
  204. *this->GetFolderBuildStreams() << " -relprog" << std::endl;
  205. }
  206. if (this->IsTargetGroup())
  207. {
  208. *this->GetFolderBuildStreams()
  209. << " -o \"" << outputDir
  210. << outputFilename << ".elf\"" << std::endl;
  211. *this->GetFolderBuildStreams() << " :extraOutputFile=\"" << outputDir
  212. << outputFilename << ".elf.ael\""
  213. << std::endl;
  214. }
  215. else
  216. {
  217. *this->GetFolderBuildStreams() << " -o \""
  218. << outputDir << outputFilename << ".as\""
  219. << std::endl;
  220. }
  221. }
  222. }
  223. void cmGhsMultiTargetGenerator::SetCompilerFlags(std::string const &config,
  224. const std::string &language,
  225. bool const notKernel)
  226. {
  227. std::map<std::string, std::string>::iterator i =
  228. this->FlagsByLanguage.find(language);
  229. if (i == this->FlagsByLanguage.end())
  230. {
  231. std::string flags;
  232. const char *lang = language.c_str();
  233. if (notKernel)
  234. {
  235. this->LocalGenerator->AddLanguageFlags(flags, lang, config);
  236. }
  237. else
  238. {
  239. this->LocalGenerator->AddLanguageFlags(
  240. flags, lang + std::string("_GHS_KERNEL"), config);
  241. }
  242. this->LocalGenerator->AddCMP0018Flags(flags, this->GeneratorTarget,
  243. lang, config);
  244. this->LocalGenerator->AddVisibilityPresetFlags(flags,
  245. this->GeneratorTarget,
  246. lang);
  247. // Append old-style preprocessor definition flags.
  248. if (std::string(" ") != std::string(this->Makefile->GetDefineFlags()))
  249. {
  250. this->LocalGenerator->AppendFlags(flags,
  251. this->Makefile->GetDefineFlags());
  252. }
  253. // Add target-specific flags.
  254. this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget,
  255. lang, config);
  256. std::map<std::string, std::string>::value_type entry(language, flags);
  257. i = this->FlagsByLanguage.insert(entry).first;
  258. }
  259. }
  260. std::string cmGhsMultiTargetGenerator::GetDefines(const std::string &language,
  261. std::string const &config)
  262. {
  263. std::map<std::string, std::string>::iterator i =
  264. this->DefinesByLanguage.find(language);
  265. if (i == this->DefinesByLanguage.end())
  266. {
  267. std::set<std::string> defines;
  268. const char *lang = language.c_str();
  269. // Add the export symbol definition for shared library objects.
  270. if (const char *exportMacro = this->GeneratorTarget->GetExportMacro())
  271. {
  272. this->LocalGenerator->AppendDefines(defines, exportMacro);
  273. }
  274. // Add preprocessor definitions for this target and configuration.
  275. this->LocalGenerator->AddCompileDefinitions(defines,
  276. this->GeneratorTarget, config,
  277. language);
  278. std::string definesString;
  279. this->LocalGenerator->JoinDefines(defines, definesString, lang);
  280. std::map<std::string, std::string>::value_type entry(language,
  281. definesString);
  282. i = this->DefinesByLanguage.insert(entry).first;
  283. }
  284. return i->second;
  285. }
  286. void cmGhsMultiTargetGenerator::WriteCompilerFlags(std::string const &,
  287. const std::string &language)
  288. {
  289. std::map<std::string, std::string>::iterator flagsByLangI =
  290. this->FlagsByLanguage.find(language);
  291. if (flagsByLangI != this->FlagsByLanguage.end())
  292. {
  293. if (!flagsByLangI->second.empty())
  294. {
  295. *this->GetFolderBuildStreams() << " " << flagsByLangI->second
  296. << std::endl;
  297. }
  298. }
  299. }
  300. void cmGhsMultiTargetGenerator::WriteCompilerDefinitions(
  301. const std::string &config, const std::string &language)
  302. {
  303. std::vector<std::string> compileDefinitions;
  304. this->GeneratorTarget->GetCompileDefinitions(compileDefinitions,
  305. config, language);
  306. for (std::vector<std::string>::const_iterator cdI =
  307. compileDefinitions.begin();
  308. cdI != compileDefinitions.end(); ++cdI)
  309. {
  310. *this->GetFolderBuildStreams() << " -D" << (*cdI) << std::endl;
  311. }
  312. }
  313. void cmGhsMultiTargetGenerator::WriteIncludes(const std::string &config,
  314. const std::string &language)
  315. {
  316. std::vector<std::string> includes =
  317. this->GeneratorTarget->GetIncludeDirectories(config, language);
  318. for (std::vector<std::string>::const_iterator includes_i = includes.begin();
  319. includes_i != includes.end(); ++includes_i)
  320. {
  321. *this->GetFolderBuildStreams() << " -I\"" << *includes_i << "\""
  322. << std::endl;
  323. }
  324. }
  325. void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries()
  326. {
  327. // library directories
  328. cmTargetDependSet tds =
  329. this->GetGlobalGenerator()->GetTargetDirectDepends(this->GeneratorTarget);
  330. for (cmTargetDependSet::iterator tdsI = tds.begin(); tdsI != tds.end();
  331. ++tdsI)
  332. {
  333. const cmGeneratorTarget *tg = *tdsI;
  334. *this->GetFolderBuildStreams() << " -L\"" << GetAbsBuildFilePath(tg)
  335. << "\"" << std::endl;
  336. }
  337. // library targets
  338. cmTarget::LinkLibraryVectorType llv =
  339. this->GeneratorTarget->Target->GetOriginalLinkLibraries();
  340. for (cmTarget::LinkLibraryVectorType::const_iterator llvI = llv.begin();
  341. llvI != llv.end(); ++llvI)
  342. {
  343. std::string libName = llvI->first;
  344. // if it is a user defined target get the full path to the lib
  345. cmTarget *tg(GetGlobalGenerator()->FindTarget(libName));
  346. if (NULL != tg)
  347. {
  348. libName = tg->GetName() + ".a";
  349. }
  350. *this->GetFolderBuildStreams() << " -l\"" << libName << "\""
  351. << std::endl;
  352. }
  353. }
  354. void cmGhsMultiTargetGenerator::WriteCustomCommands()
  355. {
  356. WriteCustomCommandsHelper(
  357. this->GeneratorTarget->Target->GetPreBuildCommands(),
  358. cmTarget::PRE_BUILD);
  359. WriteCustomCommandsHelper(
  360. this->GeneratorTarget->Target->GetPostBuildCommands(),
  361. cmTarget::POST_BUILD);
  362. }
  363. void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper(
  364. std::vector<cmCustomCommand> const &commandsSet,
  365. cmTarget::CustomCommandType const commandType)
  366. {
  367. for (std::vector<cmCustomCommand>::const_iterator commandsSetI =
  368. commandsSet.begin();
  369. commandsSetI != commandsSet.end(); ++commandsSetI)
  370. {
  371. cmCustomCommandLines const &commands = commandsSetI->GetCommandLines();
  372. for (cmCustomCommandLines::const_iterator commandI = commands.begin();
  373. commandI != commands.end(); ++commandI)
  374. {
  375. switch (commandType)
  376. {
  377. case cmTarget::PRE_BUILD:
  378. *this->GetFolderBuildStreams() << " :preexecShellSafe=";
  379. break;
  380. case cmTarget::POST_BUILD:
  381. *this->GetFolderBuildStreams() << " :postexecShellSafe=";
  382. break;
  383. default:
  384. assert("Only pre and post are supported");
  385. }
  386. cmCustomCommandLine const &command = *commandI;
  387. for (cmCustomCommandLine::const_iterator commandLineI = command.begin();
  388. commandLineI != command.end(); ++commandLineI)
  389. {
  390. std::string subCommandE =
  391. this->LocalGenerator->EscapeForShell(*commandLineI, true);
  392. if (!command.empty())
  393. {
  394. *this->GetFolderBuildStreams()
  395. << (command.begin() == commandLineI ? "'" : " ");
  396. //Need to double escape backslashes
  397. cmSystemTools::ReplaceString(subCommandE, "\\", "\\\\");
  398. }
  399. *this->GetFolderBuildStreams() << subCommandE;
  400. }
  401. if (!command.empty())
  402. {
  403. *this->GetFolderBuildStreams() << "'" << std::endl;
  404. }
  405. }
  406. }
  407. }
  408. void cmGhsMultiTargetGenerator::WriteSources(
  409. std::vector<cmSourceFile *> const &objectSources)
  410. {
  411. for (std::vector<cmSourceFile *>::const_iterator si = objectSources.begin();
  412. si != objectSources.end(); ++si)
  413. {
  414. std::vector<cmSourceGroup> sourceGroups(this->Makefile->GetSourceGroups());
  415. char const *sourceFullPath = (*si)->GetFullPath().c_str();
  416. cmSourceGroup *sourceGroup =
  417. this->Makefile->FindSourceGroup(sourceFullPath, sourceGroups);
  418. std::string sgPath(sourceGroup->GetFullName());
  419. cmSystemTools::ConvertToUnixSlashes(sgPath);
  420. cmGlobalGhsMultiGenerator::AddFilesUpToPath(
  421. this->GetFolderBuildStreams(), &this->FolderBuildStreams,
  422. this->LocalGenerator->GetBinaryDirectory(), sgPath,
  423. GhsMultiGpj::SUBPROJECT, this->RelBuildFilePath);
  424. std::string fullSourcePath((*si)->GetFullPath());
  425. if ((*si)->GetExtension() == "int" || (*si)->GetExtension() == "bsp")
  426. {
  427. *this->FolderBuildStreams[sgPath] << fullSourcePath << std::endl;
  428. }
  429. else
  430. {
  431. //WORKAROUND: GHS MULTI needs the path to use backslashes without quotes
  432. // to open files in search as of version 6.1.6
  433. cmsys::SystemTools::ReplaceString(fullSourcePath, "/", "\\");
  434. *this->FolderBuildStreams[sgPath] << fullSourcePath << std::endl;
  435. }
  436. if ("ld" != (*si)->GetExtension() && "int" != (*si)->GetExtension() &&
  437. "bsp" != (*si)->GetExtension())
  438. {
  439. this->WriteObjectLangOverride(this->FolderBuildStreams[sgPath], (*si));
  440. this->WriteObjectDir(this->FolderBuildStreams[sgPath],
  441. this->AbsBuildFilePath + sgPath);
  442. }
  443. }
  444. }
  445. void cmGhsMultiTargetGenerator::WriteObjectLangOverride(
  446. cmGeneratedFileStream *fileStream, cmSourceFile *sourceFile)
  447. {
  448. const char *rawLangProp = sourceFile->GetProperty("LANGUAGE");
  449. if (NULL != rawLangProp)
  450. {
  451. std::string sourceLangProp(rawLangProp);
  452. std::string extension(sourceFile->GetExtension());
  453. if ("CXX" == sourceLangProp && ("c" == extension || "C" == extension))
  454. {
  455. *fileStream << " -dotciscxx" << std::endl;
  456. }
  457. }
  458. }
  459. void cmGhsMultiTargetGenerator::WriteObjectDir(
  460. cmGeneratedFileStream *fileStream, std::string const &dir)
  461. {
  462. std::string workingDir(dir);
  463. cmSystemTools::ConvertToUnixSlashes(workingDir);
  464. if (!workingDir.empty())
  465. {
  466. workingDir += "/";
  467. }
  468. workingDir += "Objs";
  469. *fileStream << " -object_dir=\"" << workingDir << "\"" << std::endl;
  470. }
  471. std::string
  472. cmGhsMultiTargetGenerator::GetOutputDirectory(const std::string &config) const
  473. {
  474. std::string outputDir(AbsBuildFilePath);
  475. const char *runtimeOutputProp =
  476. this->GeneratorTarget->GetProperty("RUNTIME_OUTPUT_DIRECTORY");
  477. if (NULL != runtimeOutputProp)
  478. {
  479. outputDir = runtimeOutputProp;
  480. }
  481. std::string configCapped(cmSystemTools::UpperCase(config));
  482. const char *runtimeOutputSProp =
  483. this->GeneratorTarget
  484. ->GetProperty("RUNTIME_OUTPUT_DIRECTORY_" + configCapped);
  485. if (NULL != runtimeOutputSProp)
  486. {
  487. outputDir = runtimeOutputSProp;
  488. }
  489. cmSystemTools::ConvertToUnixSlashes(outputDir);
  490. if (!outputDir.empty())
  491. {
  492. outputDir += "/";
  493. }
  494. return outputDir;
  495. }
  496. std::string
  497. cmGhsMultiTargetGenerator::GetOutputFilename(const std::string &config) const
  498. {
  499. std::string outputFilename(this->GeneratorTarget->GetName());
  500. const char *outputNameProp =
  501. this->GeneratorTarget->GetProperty("OUTPUT_NAME");
  502. if (NULL != outputNameProp)
  503. {
  504. outputFilename = outputNameProp;
  505. }
  506. std::string configCapped(cmSystemTools::UpperCase(config));
  507. const char *outputNameSProp =
  508. this->GeneratorTarget->GetProperty(configCapped + "_OUTPUT_NAME");
  509. if (NULL != outputNameSProp)
  510. {
  511. outputFilename = outputNameSProp;
  512. }
  513. return outputFilename;
  514. }
  515. bool cmGhsMultiTargetGenerator::IsNotKernel(std::string const &config,
  516. const std::string &language)
  517. {
  518. bool output;
  519. std::vector<std::string> options;
  520. this->GeneratorTarget->GetCompileOptions(options, config, language);
  521. output =
  522. options.end() == std::find(options.begin(), options.end(), "-kernel");
  523. return output;
  524. }
  525. bool cmGhsMultiTargetGenerator::DetermineIfTargetGroup(
  526. const cmGeneratorTarget *target)
  527. {
  528. bool output = false;
  529. std::vector<cmSourceFile *> sources;
  530. std::string config =
  531. target->Target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
  532. target->GetSourceFiles(sources, config);
  533. for (std::vector<cmSourceFile *>::const_iterator sources_i = sources.begin();
  534. sources.end() != sources_i; ++sources_i)
  535. {
  536. if ("int" == (*sources_i)->GetExtension())
  537. {
  538. output = true;
  539. }
  540. }
  541. return output;
  542. }
  543. bool cmGhsMultiTargetGenerator::DetermineIfDynamicDownload(
  544. std::string const &config, const std::string &language)
  545. {
  546. std::vector<std::string> options;
  547. bool output = false;
  548. this->GeneratorTarget->GetCompileOptions(options, config, language);
  549. for (std::vector<std::string>::const_iterator options_i = options.begin();
  550. options_i != options.end(); ++options_i)
  551. {
  552. std::string option = *options_i;
  553. if (this->DDOption == option)
  554. {
  555. output = true;
  556. }
  557. }
  558. return output;
  559. }