Skip to content

Commit

Permalink
remove compile-time find_library() checks for presence of shared library
Browse files Browse the repository at this point in the history
If this package gets precompiled and cached before the user has
installed a pre-requisite shared library, then installing said library
will not fix the problem if the check for the presence happened at
compile time. Likewise, if PackageCompiler.jl is used to compile an app
on another machine, then absence of a required shared library at
compile time there cannot be rectified later by a user who downloaded
a pre-compiled app containing this package. Dropping the compile-time
check for the presence of the required shared libraries fixes this.
The exception raised by ccall() if the required library is missing is
anyway more informative than the warning messages removed here.

https://julialang.github.io/PackageCompiler.jl/dev/devdocs/relocatable_part_3/
  • Loading branch information
mgkuhn committed Jul 31, 2020
1 parent 9b35755 commit c817e28
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/WAV.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,9 @@ There is not a native backend for Windows yet.
function wavplay end
wavplay(fname) = wavplay(wavread(fname)[1:2]...)
@static if Sys.islinux()
@static if Libdl.find_library(["libpulse-simple", "libpulse-simple.so.0"]) != ""
include("wavplay-pulse.jl")
else
wavplay(data, fs) = @warn "libpulse-simple not found, wavplay will not work"
end
include("wavplay-pulse.jl")
elseif Sys.isapple()
@static if Libdl.find_library(["AudioToolbox"],
["/System/Library/Frameworks/AudioToolbox.framework/Versions/A"]) != ""
include("wavplay-audioqueue.jl")
else
wavplay(data, fs) = @warn "AudioToolbox.framework not found, wavplay will not work"
end
include("wavplay-audioqueue.jl")
else
wavplay(data, fs) = @warn "wavplay is not currently implemented on $(Sys.KERNEL)"
end
Expand Down

0 comments on commit c817e28

Please sign in to comment.