Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
29 lines
1003 B
Bash
29 lines
1003 B
Bash
# Add import paths for build inputs.
|
|
swiftWrapper_addImports () {
|
|
# Include subdirectories following both the Swift platform convention, and
|
|
# a simple `lib/swift` for Nix convenience.
|
|
for subdir in @swiftModuleSubdir@ @swiftStaticModuleSubdir@ lib/swift; do
|
|
if [[ -d "$1/$subdir" ]]; then
|
|
export NIX_SWIFTFLAGS_COMPILE+=" -I $1/$subdir"
|
|
fi
|
|
done
|
|
for subdir in @swiftLibSubdir@ @swiftStaticLibSubdir@ lib/swift; do
|
|
if [[ -d "$1/$subdir" ]]; then
|
|
export NIX_LDFLAGS+=" -L $1/$subdir"
|
|
fi
|
|
done
|
|
}
|
|
|
|
addEnvHooks "$targetOffset" swiftWrapper_addImports
|
|
|
|
# Use a postHook here because we rely on NIX_CC, which is set by the cc-wrapper
|
|
# setup hook, so delay until we're sure it was run.
|
|
swiftWrapper_postHook () {
|
|
# On Darwin, libc also contains Swift modules.
|
|
if [[ -e "$NIX_CC/nix-support/orig-libc" ]]; then
|
|
swiftWrapper_addImports "$(<$NIX_CC/nix-support/orig-libc)"
|
|
fi
|
|
}
|
|
|
|
postHooks+=(swiftWrapper_postHook)
|