forked from colemancda/swift-armv7
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-xctest.sh
executable file
·45 lines (38 loc) · 1.64 KB
/
build-xctest.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
set -e
source swift-define
echo "Create XCTest build folder ${XCTEST_BUILDDIR}"
mkdir -p $XCTEST_BUILDDIR
rm -rf $XCTEST_INSTALL_PREFIX
mkdir -p $XCTEST_INSTALL_PREFIX
# Workaround Dispatch defined with cmake and module
rm -rf ${STAGING_DIR}/usr/lib/swift/dispatch
echo "Configure XCTest"
rm -rf $XCTEST_BUILDDIR/CMakeCache.txt
LIBS="-latomic" cmake -S $XCTEST_SRCDIR -B $XCTEST_BUILDDIR -G Ninja \
-DCMAKE_INSTALL_PREFIX=${XCTEST_INSTALL_PREFIX} \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=${SWIFT_BUILD_CONFIGURATION} \
-DCMAKE_C_COMPILER=${SWIFT_NATIVE_PATH}/clang \
-DCMAKE_CXX_COMPILER=${SWIFT_NATIVE_PATH}/clang++ \
-DCMAKE_C_FLAGS="${RUNTIME_FLAGS}" \
-DCMAKE_CXX_FLAGS="${RUNTIME_FLAGS}" \
-DCMAKE_C_LINK_FLAGS="${LINK_FLAGS}" \
-DCMAKE_CXX_LINK_FLAGS="${LINK_FLAGS}" \
-DCF_DEPLOYMENT_SWIFT=ON \
-Ddispatch_DIR="${LIBDISPATCH_BUILDDIR}/cmake/modules" \
-DFoundation_DIR="${FOUNDATION_BUILDDIR}/cmake/modules" \
-DCMAKE_Swift_COMPILER=${SWIFT_NATIVE_PATH}/swiftc \
-DCMAKE_Swift_FLAGS="${SWIFTC_FLAGS}" \
-DCMAKE_Swift_FLAGS_DEBUG="" \
-DCMAKE_Swift_FLAGS_RELEASE="" \
-DCMAKE_Swift_FLAGS_RELWITHDEBINFO="" \
echo "Build XCTest"
(cd $XCTEST_BUILDDIR && ninja)
echo "Install XCTest"
(cd $XCTEST_BUILDDIR && ninja install)
# Restore Dispatch headers
cp -rf ${LIBDISPATCH_INSTALL_PREFIX}/* ${STAGING_DIR}/usr/
echo "Install XCTest to sysroot"
mv ${XCTEST_INSTALL_PREFIX}/lib/swift/linux/"$(uname -m)" ${XCTEST_INSTALL_PREFIX}/lib/swift/linux/${SWIFT_TARGET_ARCH}
cp -rf ${XCTEST_INSTALL_PREFIX}/* ${STAGING_DIR}/usr/