Merge pull request #244118 from amjoseph-nixpkgs/pr/fix/244045

lib.systems.extensions.sharedLibrary: do not `throw`
This commit is contained in:
Adam Joseph 2023-07-20 07:43:12 +00:00 committed by GitHub
commit 7363eedd89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 "";