Skip to content

Commit

Permalink
Merge pull request #244118 from amjoseph-nixpkgs/pr/fix/244045
Browse files Browse the repository at this point in the history
lib.systems.extensions.sharedLibrary: do not `throw`
  • Loading branch information
Adam Joseph authored Jul 20, 2023
2 parents bbcc727 + d278fd7 commit 7363eed
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/systems/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,18 @@ rec {
# is why we use the more obscure "bfd" and not "binutils" for this
# choice.
else "bfd";
extensions = rec {
sharedLibrary = assert final.hasSharedLibraries;
/**/ if final.isDarwin then ".dylib"
extensions = lib.optionalAttrs final.hasSharedLibraries {
sharedLibrary =
if final.isDarwin then ".dylib"
else if final.isWindows then ".dll"
else ".so";
} // {
staticLibrary =
/**/ if final.isWindows then ".lib"
else ".a";
library =
/**/ if final.isStatic then staticLibrary
else sharedLibrary;
/**/ if final.isStatic then final.extensions.staticLibrary
else final.extensions.sharedLibrary;
executable =
/**/ if final.isWindows then ".exe"
else "";
Expand Down

0 comments on commit 7363eed

Please sign in to comment.