From 1cce692594a7b8a8739060e40d703d22b2d44368 Mon Sep 17 00:00:00 2001 From: "Project Mu UEFI Bot [bot]" <45776386+uefibot@users.noreply.github.com> Date: Fri, 19 Jan 2024 15:34:08 -0500 Subject: [PATCH] Repo File Sync: Add Cargo features to Makefile.toml (#685) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit synced local file(s) with [microsoft/mu_devops](https://github.com/microsoft/mu_devops). 🤖: View the [Repo File Sync Configuration File](https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml) to see how files are synced. --- This PR was created automatically by the [repo-file-sync-action](https://github.com/BetaHuhn/repo-file-sync-action) workflow run [#7581631119](https://github.com/microsoft/mu_devops/actions/runs/7581631119) Signed-off-by: Project Mu UEFI Bot --- Makefile.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile.toml b/Makefile.toml index 3019bc956b..fdcf5643ff 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -7,6 +7,7 @@ RUSTC_BOOTSTRAP = 1 ARCH = "X64" TARGET_TRIPLE = { source = "${ARCH}", mapping = { "X64" = "x86_64-unknown-uefi", "IA32" = "i686-unknown-uefi", "AARCH64" = "aarch64-unknown-uefi", "LOCAL" = "${CARGO_MAKE_RUST_TARGET_TRIPLE}" }, condition = { env_not_set = [ "TARGET_TRIPLE" ] } } +CARGO_FEATURES_FLAG = {value = "--features ${FEATURES}", condition = {env_set = ["FEATURES"], env_true = ["FEATURES"]}} BUILD_FLAGS = "--profile ${RUSTC_PROFILE} --target ${TARGET_TRIPLE} -Zbuild-std=core,compiler_builtins,alloc -Zbuild-std-features=compiler-builtins-mem -Zunstable-options --timings=html" TEST_FLAGS = { value = "", condition = { env_not_set = ["TEST_FLAGS"] } } COV_FLAGS = { value = "--out html --exclude-files **/tests/*", condition = { env_not_set = ["COV_FLAGS"] } } @@ -47,15 +48,17 @@ description = """Builds a single rust package. Customizations: -p [development|release]: Builds in debug or release. Default: development -e ARCH=[IA32|X64|AARCH64|LOCAL]: Builds with specifed arch. Default: X64 + -e FEATURES=[feature,...]: Builds with the specified features. Default: none Example: `cargo make build RustModule` `cargo make -p release build RustModule` `cargo make -e ARCH=IA32 build RustLib` + `cargo make -e FEATURES=feature1,feature2 build RustLib` """ clear = true command = "cargo" -args = ["build", "@@split(INDIVIDUAL_PACKAGE_TARGETS, )", "@@split(BUILD_FLAGS, )"] +args = ["build", "@@split(INDIVIDUAL_PACKAGE_TARGETS, )", "@@split(BUILD_FLAGS, )", "@@split(CARGO_FEATURES_FLAG, ,remove-empty)"] dependencies = ["individual-package-targets"] [tasks.check]