| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
Warning
This document describes a new and slightly experimental build process building DXC and using LLVM's LIT tool to run DXC's tests. This workflow is complete on Linux and Unix platforms, but is incomplete but usable on Windows. Instructions for building on Windows are available in the repository readme.
DXC's build is configured using CMake and should be buildable with any preferred generator. In subsequent sections we will describe workflows using Ninja and Visual Studio. The Ninja workflow should also apply to makefile generators with minimal adaption.
Building on windows additionally requires:
Note: DXC uses submodules for some external dependencies. You must initialize the submodules in order to build DXC:
When building DXC there are a bunch of CMake options which must be set. To simplify configuration those options are collected into a CMake cache script which can be passed into the CMake tool using the -C flag. Cache scripts run before any other CMake script evaluation and can be used to initialize variables for the configuration process.
All of the most basic CMake configurations for DXC follow a similar format to:
cmake <Repository Root> \
-C <Repository Root>/cmake/caches/PredefinedParams.cmake \
-DCMAKE_BUILD_TYPE=<Build Type> \
-G <Generator>By default CMake will place the generated build output files in the directory you run CMake in. Our build system disallows running CMake in the root of the repository so you either need to create an alternate directory to run CMake in, or you can use the CMake -B <path> flag to direct CMake to place the generated files in a different location.
Open a Visual Stuido command prompt and run:
cmake <Repository Root> \
-B <Path to Output> \
-C <Repository Root>/cmake/caches/PredefinedParams.cmake \
-DCMAKE_BUILD_TYPE=<Build Type> \
-G "Visual Studio 17 2022"Open the resulting LLVM.sln placed under the <Path to Output>. DXC should build successfully with either the Visual Studio 17 2022 or Visual Studio 16 2019 generators.
Open Visual Studio and select "Open a local folder". Open the folder DXC is cloned into. If Visual Studio does not start automatically configuring the build you may need to go to the "Project" menu and select "CMake Workspace Settings" and add "enableCMake"; true to the JSON configuration file.
After CMake configuration completes you should be able to toggle the "Solution Explorer" into "CMake Targets View" to see the available build targets.
In your preferred terminal run:
cmake <Repository Root> \
-B <Path to Output> \
-C <Repository Root>/cmake/caches/PredefinedParams.cmake \
-DCMAKE_BUILD_TYPE=<Build Type> \
-G NinjaYou may substitute Ninja for Unix Makefiles to generate a makefile build. After generation completes you can run ninja or make as appropriate.
With the LIT-based testing solution, builds and tests are all run through the generated build system. Regardless of which tool you use to build DXC you should have the following targets available:
llvm-test-depends Builds all the binaries used by the tests. clang-test-depends Builds all the binaries used by the clang tests. test-depends Builds all the binaries used by all the tests. check-llvm Runs the LLVM tests after rebuilding any required out-of-date targets. check-clang Runs the Clang tests after rebuilding any required out-of-date targets. check-all Runs all available tests after rebuilding any out-of-date targets.
By convention CMake options are all capital, underscore separated words, and the first word signifies what the option applies to. In the DXC codebase there are four commonly used option prefixes:
After cloning the project, you can set up a build environment shortcut by double-clicking the utilshcthctshortcut.js file. This will create a shortcut on your desktop with a default configuration. If your system doesn't have the requisite association for .js files, this may not work. If so, open a cmd window and invoke: wscript.exe utilshcthctshortcut.js.
Tests are built using the TAEF framework which is included in the Windows Driver Kit.
To build, run this command on the HLSL Console.
hctbuildYou can also run tests with this command.
hcttestSome tests will run shaders and verify their behavior. These tests also involve a driver that can execute these shaders. See the next section on how this should be currently set up.
To see a list of additional commands available, run hcthelp
| Back | FazBrowse Home | New Git URL |