Project using various bazel features and also building a windows driver using the EWDK toolchain.
- Make sure bazelisk is installed and in your path (hint: name the binary bazel.exe). You may also need to install Microsoft's C++ redistributable as well.
- Make sure git for windows is installed and in your path.
- Make sure bazel buildifier is installed in your path if you plan to use the vscode bazel extension.
- Download the latest Enterprise WDK (EWDK) and place somewhere (mounting the ISO should also work in theory).
- Set the
EWDKDIR
environment variable to the location of the EWDK. For example, if mounted to the E drive thenEWDKDIR=E:\
. - Clone this repository and perform an initial build:
git clone [email protected]:0xf005ba11/bazel_example_project.git
cd bazel_example_project
bazel build //...
bazel run //exe
bazel test --test_output=all //...
bazel build --compilation_mode=dbg
bazel build --compilation_mode=opt
The default mode is "fastbuild" and is equivalent to a debug build.
bazel build --platforms=:windows_x86
bazel build --platforms=:windows_x64
bazel build --platforms=:windows_arm
bazel build --platforms=:windows_arm64
Note: --platforms and --compilation_mode apply to other commands as well such as run and test.
copy "$(bazel info output_base)/external/ewdk_cc_configured_toolchain/c_cpp_properties.json" "./.vscode/c_cpp_properties.json"