
Adding A Custom TargetĪs shown in Mike’s blog post, we can define our own build rule using a couple of XML files which Studio on my machine they’re in C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets.įor example, the file in that directory contains most of the targetĭefinitions for C++ compilation, linking, resources and manifests, and so on. Some more information can be gleaned by looking at the C++ build rules installed with Visual MSBuild docs (such as they are) can be found on MSDN here. We’ll review how that works, then extend it and jazz it up a bit to get some more quality-of-life targets file to create an association between a specific fileĮxtension in your project, and a build rule (“target”, in MSBuild parlance) to process those files. My jumping-off point for this enterprise was this blog post by Mike Nicolella. Included in the Git repo, but are hidden away in VS’s build extension DLLs. Up front that many of the most interesting parts vis-à-vis Visual Studio integration are not In principle you can dive into it and see what the cursed hellmaze is doing. To be fair, MSBuild is open-source on GitHub, so at least However, it does ship with Visual Studio, so if youĬan use it for your custom build steps, then you don’t need to deal with any extra add-ins or Paradigmatically muddled, cursed hellmaze. MSBuild is a stringly typed, semi-documented, XML-guzzling, This article is written against Visual Studio 2017, but it may also work in some earlier VSesīefore we begin, it’s important you understand what we’re getting into. If you don’t want to read all the explanation but just want some working code to look at, jump down We won’t quite make it to parity with a natively integrated language,īut we’re going to get as close as we can.



This post is a how-to for adding support for a custom toolchain-such as dxc, or any otherĬommand-line-invokable tool-to a Visual Studio project, by scripting MSBuild (the underlying build

Visual Studio these days has built-in support for HLSL viaįxc, but what if we want to use the next-gen dxc Usually, I’m writing in C++ using Visual Studio, and I’d like to get my shaders built using the Like many of you, when I work on a graphics project I sometimes have a need to compile some shaders. Mesh Shader Possibilities Python-Like enumerate() In C++17 Using A Custom Toolchain In Visual Studio With MSBuild
