# Translation of platform using configuration for C# targets

**URL:** https://discourse.cmake.org/t/translation-of-platform-using-configuration-for-c-targets/6630
**Category:** Development
**Created:** [October 8, 2022, 2:05pm UTC](https://discourse.cmake.org/t/translation-of-platform-using-configuration-for-c-targets/6630 "2022-10-08T14:05:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![MathiasMagnus](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mathiasmagnus/32/431_2.png) [@MathiasMagnus](https://discourse.cmake.org/u/MathiasMagnus)
#### Post date: [October 8, 2022, 2:05pm UTC](https://discourse.cmake.org/t/translation-of-platform-using-configuration-for-c-targets/6630/1 "2022-10-08T14:05:38Z")

</div>

Can someone tell me why is there a reason to translate platform names for C# targets in CMake using the configuration? Why is this snippet needed in the VisualStudio generators?

```auto
std::string platform = GetPlatformName();
if (proj) {
  std::string extension =
    cmSystemTools::GetFilenameLastExtension(proj->GetRelativePath());
  extension = cmSystemTools::LowerCase(extension);
  if (extension.compare(".csproj") == 0) {
    // Use correct platform name
    platform =
      slnData.GetConfigurationTarget(tname, plainConfig, platform);
  }
}

```

Would it be safe to assume that this translation will land on the same `platform` for every target `tname`?

\< edit \>  
I’m developing a fast path for the command-line invocation for the Visual Studio generators. When building multiple targets using CMake’s build driver, it turns into multiple as many MSBuilt invocations as targets the user specified. MSBuild is capable of building multiple targets with the same invocation under some circumstances. Becuase our CI speed is currently limited by this, I wanted to add a fast path to makeCommand generation that builds multiple targets when possible.  
\< edit/ \>

Also, is there an easy way to tell if a target is a C++ or a C# target just by it’s name?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [October 16, 2022, 2:32pm UTC](https://discourse.cmake.org/t/translation-of-platform-using-configuration-for-c-targets/6630/2 "2022-10-16T14:32:12Z")

</div>

I’d ask on [the MR that merged it](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6944). The author doesn’t seem to be on Discourse and the commit message doesn’t illuminate it for me.
