Skip to content

Commit

Permalink
rust: set empty flags if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Oct 5, 2024
1 parent 5d72dbf commit e4b7e9a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/languages/rust.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ in
defaultText = lib.literalExpression ''[ ]'';
description = ''
List of extra [targets](https://github.com/nix-community/fenix#supported-platforms-and-targets)
to install. Defaults to only the native target.
to install. Defaults to only the native target.
'';
};

Expand Down Expand Up @@ -136,8 +136,8 @@ in
if cfg.toolchain ? rust-src
then "${cfg.toolchain.rust-src}/lib/rustlib/src/rust/library"
else pkgs.rustPlatform.rustLibSrc;
RUSTFLAGS = "${moldFlags} ${cfg.rustflags}";
RUSTDOCFLAGS = "${moldFlags}";
RUSTFLAGS = lib.mkIf (moldFlags != "" || cfg.rustflags != "") (lib.concatStringsSep " " (lib.filter (x: x != "") [moldFlags cfg.rustflags]));
RUSTDOCFLAGS = lib.mkIf (moldFlags != "") moldFlags;
CFLAGS = lib.optionalString pkgs.stdenv.isDarwin "-iframework ${config.devenv.profile}/Library/Frameworks";
};

Expand Down

0 comments on commit e4b7e9a

Please sign in to comment.