Skip to content

Commit

Permalink
Conditionally import GR_jll package
Browse files Browse the repository at this point in the history
  • Loading branch information
jheinen committed Sep 22, 2022
1 parent 2aff3f6 commit 2924a1d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/GR.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
"""
module GR

import GR_jll

@static if isdefined(Base, :Experimental) &&
isdefined(Base.Experimental, Symbol("@optlevel"))
Base.Experimental.@optlevel 1
Expand Down Expand Up @@ -267,6 +265,12 @@ isatom() = isdefined(Main, :Atom) && Main.Atom isa Module && Main.Atom.isconnect
ispluto() = isdefined(Main, :PlutoRunner) && Main.PlutoRunner isa Module
isvscode() = isdefined(Main, :VSCodeServer) && Main.VSCodeServer isa Module && (isdefined(Main.VSCodeServer, :PLOT_PANE_ENABLED) ? Main.VSCodeServer.PLOT_PANE_ENABLED[] : true)

function __init__()
if !haskey(ENV, "GRDIR")
@eval import GR_jll
end
end

# Load function pointer caching mechanism
include("funcptrs.jl")

Expand Down

0 comments on commit 2924a1d

Please sign in to comment.