Skip to content

Commit

Permalink
Add FreeBSD cases in build script
Browse files Browse the repository at this point in the history
  • Loading branch information
James McLaughlin committed Dec 3, 2015
1 parent 9da5899 commit 440a052
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ KNOWN_SETTINGS=(
sil-verify-all "0" "If enabled, run the sil verifier be run after every SIL pass"
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"
swift-enable-target-linux "1" "Enable compiler support for targeting Linux"
swift-enable-target-freebsd "1" "Enable compiler support for targeting FreeBSD"
swift-runtime-enable-dtrace "0" "Enable runtime dtrace support"
swift-runtime-enable-leak-checker "0" "Enable leaks checking routines in the runtime"
use-gold-linker "" "Enable using the gold linker"
Expand Down Expand Up @@ -218,6 +219,9 @@ function set_deployment_target_based_options() {
linux-x86_64)
SWIFT_HOST_VARIANT_ARCH="x86_64"
;;
freebsd-x86_64)
SWIFT_HOST_VARIANT_ARCH="x86_64"
;;
macosx-* | iphoneos-* | iphonesimulator-* | \
appletvos-* | appletvsimulator-* | \
watchos-* | watchsimulator-*)
Expand Down Expand Up @@ -741,6 +745,12 @@ case "$(uname -s)" in
)
;;

FreeBSD)
NATIVE_TOOLS_DEPLOYMENT_TARGETS=(
"freebsd-x86_64"
)
;;

*)
echo "Unknown operating system"
exit 1
Expand Down Expand Up @@ -812,6 +822,12 @@ case "$(uname -s)" in
)
;;

FreeBSD)
STDLIB_DEPLOYMENT_TARGETS=(
"freebsd-x86_64"
)
;;

*)
echo "Unknown operating system"
exit 1
Expand Down Expand Up @@ -898,6 +914,10 @@ for deployment_target in "${STDLIB_DEPLOYMENT_TARGETS[@]}"; do
build_for_this_target=1
test_this_target=1
;;
freebsd-*)
build_for_this_target=1
test_this_target=1
;;
macosx-*)
build_for_this_target=$(not $SKIP_BUILD_OSX)
test_this_target=$(not $SKIP_TEST_OSX)
Expand Down Expand Up @@ -1644,6 +1664,23 @@ for deployment_target in "${NATIVE_TOOLS_DEPLOYMENT_TARGETS[@]}" "${CROSS_TOOLS_
"${LLDB_SOURCE_DIR}"
)
;;
FreeBSD)
cmake_options=(
"${cmake_options[@]}"
-DCMAKE_BUILD_TYPE:STRING="${LLDB_BUILD_TYPE}"
-DCMAKE_INSTALL_PREFIX:PATH="${INSTALL_PREFIX}"
-DLLDB_PATH_TO_LLVM_SOURCE:PATH="${LLVM_SOURCE_DIR}"
-DLLDB_PATH_TO_CLANG_SOURCE:PATH="${CLANG_SOURCE_DIR}"
-DLLDB_PATH_TO_SWIFT_SOURCE:PATH="${SWIFT_SOURCE_DIR}"
-DLLDB_PATH_TO_LLVM_BUILD:PATH="${llvm_build_dir}"
-DLLDB_PATH_TO_CLANG_BUILD:PATH="${llvm_build_dir}"
-DLLDB_PATH_TO_SWIFT_BUILD:PATH="${swift_build_dir}"
-DLLDB_PATH_TO_CMARK_BUILD:PATH="${cmark_build_dir}"
-DLLDB_IS_BUILDBOT_BUILD="${LLDB_IS_BUILDBOT_BUILD}"
-DLLDB_BUILD_DATE:STRING="\"${LLDB_BUILD_DATE}\""
"${LLDB_SOURCE_DIR}"
)
;;
Darwin)
# Set up flags to pass to xcodebuild
lldb_xcodebuild_options=(
Expand Down Expand Up @@ -1796,7 +1833,7 @@ tests_busted ()

for deployment_target in "${STDLIB_DEPLOYMENT_TARGETS[@]}"; do
case $deployment_target in
linux-* | macosx-*)
linux-* | freebsd-* | macosx-*)
# OK, we can run tests directly.
;;
iphoneos-* | iphonesimulator-* | appletvos-* | appletvsimulator-* | watchos-* | watchsimulator-*)
Expand Down Expand Up @@ -1990,6 +2027,8 @@ for deployment_target in "${NATIVE_TOOLS_DEPLOYMENT_TARGETS[@]}" "${CROSS_TOOLS_
case "$(uname -s)" in
Linux)
;;
FreeBSD)
;;
Darwin)
set_lldb_build_mode
pushd ${LLDB_SOURCE_DIR}
Expand Down Expand Up @@ -2026,6 +2065,9 @@ for deployment_target in "${NATIVE_TOOLS_DEPLOYMENT_TARGETS[@]}" "${CROSS_TOOLS_
continue
fi
LIB_TARGET="linux"
if [[ `uname -s` == "FreeBSD" ]]; then
LIB_TARGET="freebsd"
fi
if [[ `uname -s` == "Darwin" ]]; then
LIB_TARGET="macosx"
fi
Expand Down

0 comments on commit 440a052

Please sign in to comment.