Skip to content

Commit

Permalink
document targetFeatures better
Browse files Browse the repository at this point in the history
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=`.`
  • Loading branch information
flokli committed Jun 10, 2024
1 parent cf03486 commit 5bc3f6b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crate2nix/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions crate2nix/templates/Cargo.nix.tera
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions sample_projects/bin_with_git_submodule_dep/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions sample_projects/codegen/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions sample_projects/sub_dir_crates/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5bc3f6b

Please sign in to comment.