Skip to content

Commit

Permalink
clang_compile_flags!: add -isystem ${includedir} on FreeBSD
Browse files Browse the repository at this point in the history
Currently several JLLs need to manually add `-I${includedir}` to their
CPPFLAGS in order to build correctly on FreeBSD. Fix this by adjusting
the clang wrapper.

See JuliaPackaging/Yggdrasil#3949
  • Loading branch information
fingolfin committed Mar 1, 2022
1 parent f78a16a commit 0603719
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Runner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,22 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
min_macos_version_flag(p),
])
end
if Sys.isfreebsd(p)
# clang on FreeBSD does not have `SYSROOT/usr/local` (which in our build
# environments is a symlink to $includedir = "$(prefix)/include") in its
# default list of include search directories. As a result, quite some
# builders that work fine everywhere else need to add something like
# `-I${includedir}` to their CPPFLAGS when building for FreeBSD.
#
# To remove the need for this, we simply add it here. We use `-isystem`
# instead of `-I` to mimic what is done in clang builds for other operating
# systems. It is still not a perfect match, as the order of the default
# search directories differs, but this should not matter in practice.
#
# See also https://github.com/JuliaPackaging/Yggdrasil/issues/3949 and
# https://github.com/JuliaPackaging/Yggdrasil/pull/3969 for further details.
append!(flags, ["-isystem", "$(prefix)/include"])
end
return flags
end

Expand Down

0 comments on commit 0603719

Please sign in to comment.