Skip to content

Commit 440a052

Browse files
author
James McLaughlin
committed
Add FreeBSD cases in build script
1 parent 9da5899 commit 440a052

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

utils/build-script-impl

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ KNOWN_SETTINGS=(
171171
sil-verify-all "0" "If enabled, run the sil verifier be run after every SIL pass"
172172
swift-enable-ast-verifier "1" "If enabled, and the assertions are enabled, the built Swift compiler will run the AST verifier every time it is invoked"
173173
swift-enable-target-linux "1" "Enable compiler support for targeting Linux"
174+
swift-enable-target-freebsd "1" "Enable compiler support for targeting FreeBSD"
174175
swift-runtime-enable-dtrace "0" "Enable runtime dtrace support"
175176
swift-runtime-enable-leak-checker "0" "Enable leaks checking routines in the runtime"
176177
use-gold-linker "" "Enable using the gold linker"
@@ -218,6 +219,9 @@ function set_deployment_target_based_options() {
218219
linux-x86_64)
219220
SWIFT_HOST_VARIANT_ARCH="x86_64"
220221
;;
222+
freebsd-x86_64)
223+
SWIFT_HOST_VARIANT_ARCH="x86_64"
224+
;;
221225
macosx-* | iphoneos-* | iphonesimulator-* | \
222226
appletvos-* | appletvsimulator-* | \
223227
watchos-* | watchsimulator-*)
@@ -741,6 +745,12 @@ case "$(uname -s)" in
741745
)
742746
;;
743747

748+
FreeBSD)
749+
NATIVE_TOOLS_DEPLOYMENT_TARGETS=(
750+
"freebsd-x86_64"
751+
)
752+
;;
753+
744754
*)
745755
echo "Unknown operating system"
746756
exit 1
@@ -812,6 +822,12 @@ case "$(uname -s)" in
812822
)
813823
;;
814824

825+
FreeBSD)
826+
STDLIB_DEPLOYMENT_TARGETS=(
827+
"freebsd-x86_64"
828+
)
829+
;;
830+
815831
*)
816832
echo "Unknown operating system"
817833
exit 1
@@ -898,6 +914,10 @@ for deployment_target in "${STDLIB_DEPLOYMENT_TARGETS[@]}"; do
898914
build_for_this_target=1
899915
test_this_target=1
900916
;;
917+
freebsd-*)
918+
build_for_this_target=1
919+
test_this_target=1
920+
;;
901921
macosx-*)
902922
build_for_this_target=$(not $SKIP_BUILD_OSX)
903923
test_this_target=$(not $SKIP_TEST_OSX)
@@ -1644,6 +1664,23 @@ for deployment_target in "${NATIVE_TOOLS_DEPLOYMENT_TARGETS[@]}" "${CROSS_TOOLS_
16441664
"${LLDB_SOURCE_DIR}"
16451665
)
16461666
;;
1667+
FreeBSD)
1668+
cmake_options=(
1669+
"${cmake_options[@]}"
1670+
-DCMAKE_BUILD_TYPE:STRING="${LLDB_BUILD_TYPE}"
1671+
-DCMAKE_INSTALL_PREFIX:PATH="${INSTALL_PREFIX}"
1672+
-DLLDB_PATH_TO_LLVM_SOURCE:PATH="${LLVM_SOURCE_DIR}"
1673+
-DLLDB_PATH_TO_CLANG_SOURCE:PATH="${CLANG_SOURCE_DIR}"
1674+
-DLLDB_PATH_TO_SWIFT_SOURCE:PATH="${SWIFT_SOURCE_DIR}"
1675+
-DLLDB_PATH_TO_LLVM_BUILD:PATH="${llvm_build_dir}"
1676+
-DLLDB_PATH_TO_CLANG_BUILD:PATH="${llvm_build_dir}"
1677+
-DLLDB_PATH_TO_SWIFT_BUILD:PATH="${swift_build_dir}"
1678+
-DLLDB_PATH_TO_CMARK_BUILD:PATH="${cmark_build_dir}"
1679+
-DLLDB_IS_BUILDBOT_BUILD="${LLDB_IS_BUILDBOT_BUILD}"
1680+
-DLLDB_BUILD_DATE:STRING="\"${LLDB_BUILD_DATE}\""
1681+
"${LLDB_SOURCE_DIR}"
1682+
)
1683+
;;
16471684
Darwin)
16481685
# Set up flags to pass to xcodebuild
16491686
lldb_xcodebuild_options=(
@@ -1796,7 +1833,7 @@ tests_busted ()
17961833

17971834
for deployment_target in "${STDLIB_DEPLOYMENT_TARGETS[@]}"; do
17981835
case $deployment_target in
1799-
linux-* | macosx-*)
1836+
linux-* | freebsd-* | macosx-*)
18001837
# OK, we can run tests directly.
18011838
;;
18021839
iphoneos-* | iphonesimulator-* | appletvos-* | appletvsimulator-* | watchos-* | watchsimulator-*)
@@ -1990,6 +2027,8 @@ for deployment_target in "${NATIVE_TOOLS_DEPLOYMENT_TARGETS[@]}" "${CROSS_TOOLS_
19902027
case "$(uname -s)" in
19912028
Linux)
19922029
;;
2030+
FreeBSD)
2031+
;;
19932032
Darwin)
19942033
set_lldb_build_mode
19952034
pushd ${LLDB_SOURCE_DIR}
@@ -2026,6 +2065,9 @@ for deployment_target in "${NATIVE_TOOLS_DEPLOYMENT_TARGETS[@]}" "${CROSS_TOOLS_
20262065
continue
20272066
fi
20282067
LIB_TARGET="linux"
2068+
if [[ `uname -s` == "FreeBSD" ]]; then
2069+
LIB_TARGET="freebsd"
2070+
fi
20292071
if [[ `uname -s` == "Darwin" ]]; then
20302072
LIB_TARGET="macosx"
20312073
fi

0 commit comments

Comments
 (0)