Skip to content

Commit

Permalink
Look for libTracyClient.so in the non-private libdir
Browse files Browse the repository at this point in the history
For some reason, we only move this to the private libdir during
installation so we should check the non-private libdir also to support
local builds.
  • Loading branch information
topolarity committed Jan 8, 2024
1 parent 612eec0 commit 5610ed1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Tracy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ codegen, GC, and runtime-internal mutexes/locks.
"""
module Tracy

using Base.Linking: private_libdir
using Base.Linking: libdir, private_libdir
using LibTracyClient_jll: libTracyClient
using Libdl: dllist, dlopen, dlext
using ExprTools: splitdef, combinedef
Expand Down Expand Up @@ -96,6 +96,15 @@ function __init__()
path
catch e
@assert e isa ErrorException && contains(e.msg, "could not load library")
try
# When compiled locally without installation, libTracyClient might be in
# the non-private libdir
path = joinpath(libdir(), "libTracyClient.$(dlext)")
dlopen(path)
path
catch e
@assert e isa ErrorException && contains(e.msg, "could not load library")
end
end
global libtracy = something(base_tracy_lib, libTracyClient)
toggle_fn = @cfunction((data, tracy_srcloc_ptr, enable_ptr) -> begin
Expand Down

0 comments on commit 5610ed1

Please sign in to comment.