Skip to content

Commit ee99bf1

Browse files
authored
[build] prefer picking up sqlite3 from Darwin SDK for llbuild (swiftlang#28440)
* [build] prefer picking up sqlite3 from Darwin SDK for llbuild When building llbuild on Darwin platforms, ensure that we prefer the SQLite from the SDK instead of picking one found elsewhere (e.g. in /usr/include ) Also consider only the SQLite dylib shipped with the OS. Addresses rdar://problem/57300418
1 parent 12bda79 commit ee99bf1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

utils/build-script-impl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,6 +2098,20 @@ for host in "${ALL_HOSTS[@]}"; do
20982098
-Ddispatch_DIR:PATH=$(build_directory ${host} libdispatch)/cmake/modules
20992099
-DFoundation_DIR:PATH=$(build_directory ${host} foundation)/cmake/modules
21002100
)
2101+
2102+
# Ensure on Darwin platforms that we consider only the SQLite headers
2103+
# from the SDK instead of picking ones found elsewhere
2104+
# (e.g. in /usr/include )
2105+
# Also consider only the SQLite dylib shipped with the OS
2106+
# to avoid mismatch with the headers
2107+
if [[ "$(uname -s)" = "Darwin" ]]; then
2108+
cmake_options=(
2109+
"${cmake_options[@]}"
2110+
2111+
-DSQLite3_INCLUDE_DIR:PATH="$(xcrun -sdk macosx -show-sdk-path)/usr/include"
2112+
-DSQLite3_LIBRARY:PATH="/usr/lib/libsqlite3.dylib"
2113+
)
2114+
fi
21012115
;;
21022116
xctest)
21032117
SWIFTC_BIN="$(build_directory_bin ${LOCAL_HOST} swift)/swiftc"

0 commit comments

Comments
 (0)