MCPcopy Create free account
hub / github.com/Kitware/CMake / WriteExtraSource

Method WriteExtraSource

Source/cmVisualStudio10TargetGenerator.cxx:2257–2491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2255}
2256
2257void 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;

Callers 1

WriteAllSourcesMethod · 0.95

Calls 15

WriteSourceMethod · 0.95
FinishWritingSourceMethod · 0.95
cmIsOnFunction · 0.85
cmNonemptyFunction · 0.85
GetExtensionMethod · 0.80
c_strMethod · 0.80
TargetsWindowsPhoneMethod · 0.80
TargetsWindowsStoreMethod · 0.80
SetHasElementsMethod · 0.80

Tested by

no test coverage detected