git.iko.soy/rowtype-yoga/purescript-native
on aded024 help sign in
42 lines 1.2 kB history raw
1# Xcode support script. Intended to be added to and called from "Run Script" build phase.
2#
3#!/bin/sh
5echo "CONFIGURATION =" "$CONFIGURATION"
6echo "ARCHITECTURES =" "$ARCHS"
8IS_DEBUG="$PROJECT_TEMP_DIR/is_debug"
9IS_RELEASE="$PROJECT_TEMP_DIR/is_release"
11if [[ "$CONFIGURATION" == "Debug" ]] ; then
12 if [ ! -f "$IS_DEBUG" ] ; then
13 make clean
14 touch "$IS_DEBUG"
15 fi
16 rm "$IS_RELEASE" > /dev/null 2>&1 || true
17 OBJECT_TYPE=debug-object
18else
19 if [ ! -f "$IS_RELEASE" ] ; then
20 make clean
21 touch "$IS_RELEASE"
22 fi
23 rm "$IS_DEBUG" > /dev/null 2>&1 || true
24 OBJECT_TYPE=release-object
25fi
27## Create compiler switches for architectures
29for arch_ in $ARCHS ; do
30 ARCH_OPTS+="-arch $arch_ "
31 if ! file output/bin/purescript.o | grep -q $arch_; then
32 make clean
33 fi
34 # TODO: make this more future-proof
35 # Note: -flto optimization causes problems with the source-level
36 # debugger. Disable bitcode temporarily if necessary.
37 if [[ $ENABLE_BITCODE == YES && $arch == arm64 ]] ; then
38 FLTO="-flto"
39 fi
40done
42make $OBJECT_TYPE ${PSC_PKG} CXXFLAGS="$ARCH_OPTS $FLTO -isysroot $SDKROOT" LD="clang -Wl,-r -nostdlib $ARCH_OPTS" -j`sysctl -n hw.ncpu`