| 3309 | } |
| 3310 | |
| 3311 | std::string cmGeneratorTarget::GetPchUseCompileOptions( |
| 3312 | std::string const& config, std::string const& language, |
| 3313 | std::string const& arch) |
| 3314 | { |
| 3315 | auto const inserted = this->PchUseCompileOptions.insert( |
| 3316 | std::make_pair(language + config + arch, "")); |
| 3317 | if (inserted.second) { |
| 3318 | std::string& useOptionList = inserted.first->second; |
| 3319 | |
| 3320 | if (this->GetPropertyAsBool("PCH_WARN_INVALID")) { |
| 3321 | useOptionList = this->Makefile->GetSafeDefinition( |
| 3322 | cmStrCat("CMAKE_", language, "_COMPILE_OPTIONS_INVALID_PCH")); |
| 3323 | } |
| 3324 | |
| 3325 | std::string const useOptVar = |
| 3326 | cmStrCat(language, "_COMPILE_OPTIONS_USE_PCH"); |
| 3327 | |
| 3328 | std::string const& useOptionListProperty = |
| 3329 | this->GetSafeProperty(useOptVar); |
| 3330 | |
| 3331 | useOptionList = cmStrCat( |
| 3332 | useOptionList, ';', |
| 3333 | useOptionListProperty.empty() |
| 3334 | ? this->Makefile->GetSafeDefinition(cmStrCat("CMAKE_", useOptVar)) |
| 3335 | : useOptionListProperty); |
| 3336 | |
| 3337 | std::string const pchHeader = this->GetPchHeader(config, language, arch); |
| 3338 | std::string const pchFile = this->GetPchFile(config, language, arch); |
| 3339 | |
| 3340 | if (GlobalGenerator->IsFastbuild()) { |
| 3341 | // Account for potential spaces in a shell-friendly way. |
| 3342 | cmSystemTools::ReplaceString(useOptionList, "<PCH_HEADER>", |
| 3343 | cmStrCat('"', pchHeader, '"')); |
| 3344 | cmSystemTools::ReplaceString(useOptionList, "<PCH_FILE>", |
| 3345 | cmStrCat('"', pchFile, '"')); |
| 3346 | } else { |
| 3347 | cmSystemTools::ReplaceString(useOptionList, "<PCH_HEADER>", pchHeader); |
| 3348 | cmSystemTools::ReplaceString(useOptionList, "<PCH_FILE>", pchFile); |
| 3349 | } |
| 3350 | } |
| 3351 | return inserted.first->second; |
| 3352 | } |
| 3353 | |
| 3354 | void cmGeneratorTarget::AddSourceFileToUnityBatch( |
| 3355 | std::string const& sourceFilename) |
no test coverage detected