Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
7639 views
1
#!/bin/bash
2
3
# Call this script from a "Run Script" target in the Xcode project to
4
# cross compile MuPDF and third party libraries using the regular Makefile.
5
# Also see "iOS" section in Makerules.
6
7
if [ ! -e ../../generated/gen_cmap_korea.h ]
8
then
9
echo 'ERROR: You are missing the generated files.'
10
echo 'ERROR: Please run "make generate" from the mupdf directory.'
11
exit 1
12
fi
13
14
export OS=ios
15
export build=$(echo $CONFIGURATION | tr A-Z a-z)
16
17
FLAGS="-Wno-unused-function -Wno-empty-body"
18
for A in $ARCHS
19
do
20
FLAGS="$FLAGS -arch $A"
21
done
22
23
OUT=build/$build-$OS-$(echo $ARCHS | tr ' ' '-')
24
25
echo Compiling libraries for $ARCHS.
26
make -j4 -C ../.. OUT=$OUT XCFLAGS="$FLAGS" XLDFLAGS="$FLAGS" third libs || exit 1
27
28
echo Copying library to $BUILT_PRODUCTS_DIR/.
29
mkdir -p "$BUILT_PRODUCTS_DIR"
30
cp -f ../../$OUT/lib*.a $BUILT_PRODUCTS_DIR
31
ranlib $BUILT_PRODUCTS_DIR/lib*.a
32
33
echo Done.
34
35