From 5bc3f6b1c50d32972158fbd3158b853bdf83ae9b Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 10 Jun 2024 10:12:13 +0300 Subject: [PATCH] document targetFeatures better I initially misinterpreted this as a hook to influence the list of features a crate is built with, depending on the target, but this is just the strings passed to `rustc`'s `-C target-feature=`.` --- crate2nix/Cargo.nix | 2 ++ crate2nix/templates/Cargo.nix.tera | 2 ++ sample_projects/bin_with_git_submodule_dep/Cargo.nix | 2 ++ sample_projects/codegen/Cargo.nix | 2 ++ sample_projects/sub_dir_crates/Cargo.nix | 2 ++ 5 files changed, 10 insertions(+) diff --git a/crate2nix/Cargo.nix b/crate2nix/Cargo.nix index 0766ec62..a5b7ebc5 100644 --- a/crate2nix/Cargo.nix +++ b/crate2nix/Cargo.nix @@ -14,6 +14,8 @@ , rootFeatures ? [ "default" ] # If true, throw errors instead of issueing deprecation warnings. , strictDeprecation ? false + # Elements to add to the `-C target-feature=` argument passed to `rustc` + # (separated by `,`, prefixed with `+`). # Used for conditional compilation based on CPU feature detection. , targetFeatures ? [] # Whether to perform release builds: longer compile times, faster binaries. diff --git a/crate2nix/templates/Cargo.nix.tera b/crate2nix/templates/Cargo.nix.tera index 059427c3..50c9f8e0 100644 --- a/crate2nix/templates/Cargo.nix.tera +++ b/crate2nix/templates/Cargo.nix.tera @@ -16,6 +16,8 @@ , rootFeatures ? [ "default" ] # If true, throw errors instead of issueing deprecation warnings. , strictDeprecation ? false + # Elements to add to the `-C target-feature=` argument passed to `rustc` + # (separated by `,`, prefixed with `+`). # Used for conditional compilation based on CPU feature detection. , targetFeatures ? [] # Whether to perform release builds: longer compile times, faster binaries. diff --git a/sample_projects/bin_with_git_submodule_dep/Cargo.nix b/sample_projects/bin_with_git_submodule_dep/Cargo.nix index fcc0fbda..8212fe3b 100644 --- a/sample_projects/bin_with_git_submodule_dep/Cargo.nix +++ b/sample_projects/bin_with_git_submodule_dep/Cargo.nix @@ -14,6 +14,8 @@ , rootFeatures ? [ "default" ] # If true, throw errors instead of issueing deprecation warnings. , strictDeprecation ? false + # Elements to add to the `-C target-feature=` argument passed to `rustc` + # (separated by `,`, prefixed with `+`). # Used for conditional compilation based on CPU feature detection. , targetFeatures ? [] # Whether to perform release builds: longer compile times, faster binaries. diff --git a/sample_projects/codegen/Cargo.nix b/sample_projects/codegen/Cargo.nix index 3c874039..c3351881 100644 --- a/sample_projects/codegen/Cargo.nix +++ b/sample_projects/codegen/Cargo.nix @@ -14,6 +14,8 @@ , rootFeatures ? [ "default" ] # If true, throw errors instead of issueing deprecation warnings. , strictDeprecation ? false + # Elements to add to the `-C target-feature=` argument passed to `rustc` + # (separated by `,`, prefixed with `+`). # Used for conditional compilation based on CPU feature detection. , targetFeatures ? [] # Whether to perform release builds: longer compile times, faster binaries. diff --git a/sample_projects/sub_dir_crates/Cargo.nix b/sample_projects/sub_dir_crates/Cargo.nix index 966baec8..deeec281 100644 --- a/sample_projects/sub_dir_crates/Cargo.nix +++ b/sample_projects/sub_dir_crates/Cargo.nix @@ -14,6 +14,8 @@ , rootFeatures ? [ "default" ] # If true, throw errors instead of issueing deprecation warnings. , strictDeprecation ? false + # Elements to add to the `-C target-feature=` argument passed to `rustc` + # (separated by `,`, prefixed with `+`). # Used for conditional compilation based on CPU feature detection. , targetFeatures ? [] # Whether to perform release builds: longer compile times, faster binaries.