| 2255 | } |
| 2256 | |
| 2257 | void cmVisualStudio10TargetGenerator::WriteExtraSource( |
| 2258 | Elem& e1, cmSourceFile const* sf, ConfigToSettings& toolSettings) |
| 2259 | { |
| 2260 | bool toolHasSettings = false; |
| 2261 | char const* tool = "None"; |
| 2262 | std::string settingsGenerator; |
| 2263 | std::string settingsLastGenOutput; |
| 2264 | std::string sourceLink; |
| 2265 | std::string subType; |
| 2266 | std::string copyToOutDir; |
| 2267 | std::string includeInVsix; |
| 2268 | std::string ext = cmSystemTools::LowerCase(sf->GetExtension()); |
| 2269 | |
| 2270 | if (this->ProjectType == VsProjectType::csproj && !this->InSourceBuild) { |
| 2271 | toolHasSettings = true; |
| 2272 | } |
| 2273 | if (ext == "hlsl"_s) { |
| 2274 | tool = "FXCompile"; |
| 2275 | // Figure out the type of shader compiler to use. |
| 2276 | if (cmValue st = sf->GetProperty("VS_SHADER_TYPE")) { |
| 2277 | for (std::string const& config : this->Configurations) { |
| 2278 | toolSettings[config]["ShaderType"] = *st; |
| 2279 | } |
| 2280 | } |
| 2281 | // Figure out which entry point to use if any |
| 2282 | if (cmValue se = sf->GetProperty("VS_SHADER_ENTRYPOINT")) { |
| 2283 | for (std::string const& config : this->Configurations) { |
| 2284 | toolSettings[config]["EntryPointName"] = *se; |
| 2285 | } |
| 2286 | } |
| 2287 | // Figure out which shader model to use if any |
| 2288 | if (cmValue sm = sf->GetProperty("VS_SHADER_MODEL")) { |
| 2289 | for (std::string const& config : this->Configurations) { |
| 2290 | toolSettings[config]["ShaderModel"] = *sm; |
| 2291 | } |
| 2292 | } |
| 2293 | // Figure out which output header file to use if any |
| 2294 | if (cmValue ohf = sf->GetProperty("VS_SHADER_OUTPUT_HEADER_FILE")) { |
| 2295 | for (std::string const& config : this->Configurations) { |
| 2296 | toolSettings[config]["HeaderFileOutput"] = *ohf; |
| 2297 | } |
| 2298 | } |
| 2299 | // Figure out which variable name to use if any |
| 2300 | if (cmValue vn = sf->GetProperty("VS_SHADER_VARIABLE_NAME")) { |
| 2301 | for (std::string const& config : this->Configurations) { |
| 2302 | toolSettings[config]["VariableName"] = *vn; |
| 2303 | } |
| 2304 | } |
| 2305 | // Figure out if there's any additional flags to use |
| 2306 | if (cmValue saf = sf->GetProperty("VS_SHADER_FLAGS")) { |
| 2307 | cmGeneratorExpression ge(*this->LocalGenerator->GetCMakeInstance()); |
| 2308 | std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*saf); |
| 2309 | |
| 2310 | for (std::string const& config : this->Configurations) { |
| 2311 | std::string evaluated = cge->Evaluate(this->LocalGenerator, config); |
| 2312 | |
| 2313 | if (!evaluated.empty()) { |
| 2314 | toolSettings[config]["AdditionalOptions"] = evaluated; |
no test coverage detected