Skip to content

Commit 06d62f4

Browse files
only load CompilerSupportLibraries_jll when needed
1 parent 3aee6c1 commit 06d62f4

File tree

7 files changed

+30
-10
lines changed

7 files changed

+30
-10
lines changed

stdlib/LibCURL_jll/src/LibCURL_jll.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ if !(Sys.iswindows() || Sys.isapple())
88
# On Windows and macOS we use system SSL/crypto libraries
99
using OpenSSL_jll
1010
end
11-
using CompilerSupportLibraries_jll
11+
if Sys.iswindows()
12+
using CompilerSupportLibraries_jll
13+
end
1214

1315
export libcurl
1416

stdlib/LibGit2_jll/src/LibGit2_jll.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ if !(Sys.iswindows() || Sys.isapple())
88
# On Windows and macOS we use system SSL/crypto libraries
99
using OpenSSL_jll
1010
end
11-
using CompilerSupportLibraries_jll
11+
if Sys.iswindows()
12+
using CompilerSupportLibraries_jll
13+
end
1214

1315
export libgit2
1416

stdlib/LibSSH2_jll/src/LibSSH2_jll.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ using Base, Libdl, Zlib_jll
77
if !Sys.iswindows()
88
# On Windows we use system SSL/crypto libraries
99
using OpenSSL_jll
10+
else
11+
using CompilerSupportLibraries_jll
1012
end
11-
using CompilerSupportLibraries_jll
1213

1314
export libssh2
1415

stdlib/LibUnwind_jll/src/LibUnwind_jll.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
baremodule LibUnwind_jll
66
using Base, Libdl
7-
using CompilerSupportLibraries_jll
87
using Zlib_jll
8+
if !Sys.isfreebsd()
9+
using CompilerSupportLibraries_jll
10+
end
911

1012
export libunwind
1113

@@ -28,7 +30,9 @@ const libunwind = LazyLibrary(_libunwind_path, dependencies=_libunwind_dependenc
2830

2931

3032
function eager_mode()
31-
CompilerSupportLibraries_jll.eager_mode()
33+
@static if !Sys.isfreebsd()
34+
CompilerSupportLibraries_jll.eager_mode()
35+
end
3236
Zlib_jll.eager_mode()
3337
dlopen(libunwind)
3438
end

stdlib/MPFR_jll/src/MPFR_jll.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
## dummy stub for https://github.com/JuliaBinaryWrappers/MPFR_jll.jl
44
baremodule MPFR_jll
5-
using Base, Libdl, GMP_jll, CompilerSupportLibraries_jll
5+
using Base, Libdl, GMP_jll
6+
if Sys.iswindows()
7+
using CompilerSupportLibraries_jll
8+
end
69

710
export libmpfr
811

stdlib/Zstd_jll/src/Zstd_jll.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
## dummy stub for https://github.com/JuliaBinaryWrappers/Zstd_jll.j:
44
#
55
baremodule Zstd_jll
6-
using Base, Libdl, CompilerSupportLibraries_jll
6+
using Base, Libdl
7+
if Sys.iswindows()
8+
using CompilerSupportLibraries_jll
9+
end
710

811
export libzstd, zstd, zstdmt
912

@@ -79,10 +82,10 @@ zstdmt() = adjust_ENV(`$(joinpath(Sys.BINDIR, Base.PRIVATE_LIBEXECDIR, zstdmt_ex
7982

8083
# Function to eagerly dlopen our library and thus resolve all dependencies
8184
function eager_mode()
82-
dlopen(libzstd)
8385
@static if Sys.iswindows()
8486
CompilerSupportLibraries_jll.eager_mode()
8587
end
88+
dlopen(libzstd)
8689
end
8790

8891
is_available() = true

stdlib/nghttp2_jll/src/nghttp2_jll.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
## dummy stub for https://github.com/JuliaBinaryWrappers/nghttp2_jll.jl
44
baremodule nghttp2_jll
5-
using Base, Libdl, CompilerSupportLibraries_jll
5+
using Base, Libdl
6+
if Sys.iswindows()
7+
using CompilerSupportLibraries_jll
8+
end
69

710
export libnghttp2
811

@@ -31,7 +34,9 @@ const libnghttp2 = LazyLibrary(_libnghttp2_path, dependencies=_libnghttp2_depend
3134

3235
function eager_mode()
3336
dlopen(libnghttp2)
34-
Sys.iswindows() && CompilerSupportLibraries_jll.eager_mode()
37+
@static if Sys.iswindows()
38+
CompilerSupportLibraries_jll.eager_mode()
39+
end
3540
end
3641
is_available() = true
3742

0 commit comments

Comments
 (0)