-
Notifications
You must be signed in to change notification settings - Fork 71
/
flags.sh
executable file
·69 lines (57 loc) · 1.83 KB
/
flags.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
armflags () {
export ARM_CC=$(xcrun -find -sdk iphoneos clang)
export ARM_CXX=$(xcrun -find -sdk iphoneos clang++)
export ARM_LD=$(xcrun -find -sdk iphoneos ld)
export ARM_CFLAGS="-arch $1"
export ARM_CFLAGS="$ARM_CFLAGS -I$IOSSDKROOT/usr/include"
export ARM_CFLAGS="$ARM_CFLAGS -isysroot $IOSSDKROOT"
export ARM_CFLAGS="$ARM_CFLAGS -miphoneos-version-min=$SDKVER"
export ARM_CXXFLAGS="-arch $1"
export ARM_CXXFLAGS="$ARM_CFLAGS -I$IOSSDKROOT/usr/include"
export ARM_CXXFLAGS="$ARM_CFLAGS -isysroot $IOSSDKROOT"
export ARM_CXXFLAGS="$ARM_CFLAGS -miphoneos-version-min=$SDKVER"
export ARM_LDFLAGS="-arch $1 -isysroot $IOSSDKROOT"
export ARM_LDFLAGS="$ARM_LDFLAGS -miphoneos-version-min=$SDKVER"
export ARM_CFLAGS="$ARM_CFLAGS -O3"
# uncomment this line if you want debugging stuff
# export ARM_CFLAGS="$ARM_CFLAGS -O0 -g"
# apply ARM_XX values
export CC="$ARM_CC"
export CXX="$ARM_CXX"
export CFLAGS="$ARM_CFLAGS"
export CXXFLAGS="$ARM_CXXFLAGS"
export LD="$ARM_LD"
export LDFLAGS="$ARM_LDFLAGS"
# export what we are building for
export BUILDINGFOR="$1"
}
intelflags () {
export INTEL_CC=$(xcrun -find -sdk iphonesimulator clang)
export INTEL_LD=$(xcrun -find -sdk iphonesimulator ld)
export INTEL_CFLAGS="-arch $1"
export INTEL_CFLAGS="$INTEL_CFLAGS -I$SIMSDKROOT/usr/include"
# apply INTEL_CC values
export CC="$INTEL_CC"
export CCP="$INTEL_CC -E"
export CFLAGS="$INTEL_CFLAGS"
export LD="$INTEL_LD"
# export what we are building for
export BUILDINGFOR="$1"
}
save() {
export OLD_CC="$CC"
export OLD_CXX="$CXX"
export OLD_CFLAGS="$CFLAGS"
export OLD_CXXFLAGS="$CXXFLAGS"
export OLD_LDFLAGS="$LDFLAGS"
export OLD_CPP="$CPP"
}
restore () {
export CC="$OLD_CC"
export CXX="$OLD_CXX"
export CFLAGS="$OLD_CFLAGS"
export CXXFLAGS="$OLD_CXXFLAGS"
export LDFLAGS="$OLD_LDFLAGS"
export CPP="$OLD_CPP"
}