1 <project name="gdx-freetype-IOS-32" basedir="." default="postcompile">
\r
2 <!-- include the environment -->
\r
3 <property environment="env"/>
\r
4 <!-- output directory for temporary object files -->
\r
5 <property name="buildDir" value="target/ios32" />
\r
6 <!-- output directory for the shared library -->
\r
7 <property name="libsDir" value="../libs/ios32" />
\r
8 <!-- the name of the shared library -->
\r
9 <property name="libName" value="libgdx-freetype.a"/>
\r
10 <!-- the jni header jniPlatform to use -->
\r
11 <property name="jniPlatform" value="mac"/>
\r
12 <!-- the compilerPrefix for the C & C++ compilers -->
\r
13 <property name="compilerPrefix" value=""/>
\r
14 <property name="iphoneos-platform" value="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin"/>
\r
15 <property name="iphoneos-sdk" value="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/"/>
\r
16 <property name="iphonesimulator-platform" value="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin"/>
\r
17 <property name="iphonesimulator-sdk" value="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk"/>
\r
19 <!-- define gcc compiler, options and files to compile -->
\r
20 <property name="gcc" value="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"/>
\r
21 <property name="gcc-opts" value="-c -Wall -O2 -miphoneos-version-min=5.1 -DFT2_BUILD_LIBRARY"/>
\r
22 <fileset id="gcc-files" dir="./">
\r
23 <exclude name="target/"/>
\r
24 <include name="memcpy_wrap.c"/>
25 <include name="freetype-2.4.10/src/base/ftsystem.c"/>
26 <include name="freetype-2.4.10/src/base/ftinit.c"/>
27 <include name="freetype-2.4.10/src/base/ftdebug.c"/>
28 <include name="freetype-2.4.10/src/base/ftbase.c"/>
29 <include name="freetype-2.4.10/src/base/ftbbox.c"/>
30 <include name="freetype-2.4.10/src/base/ftglyph.c"/>
31 <include name="freetype-2.4.10/src/base/ftbdf.c"/>
32 <include name="freetype-2.4.10/src/base/ftbitmap.c"/>
33 <include name="freetype-2.4.10/src/base/ftcid.c"/>
34 <include name="freetype-2.4.10/src/base/ftfstype.c"/>
35 <include name="freetype-2.4.10/src/base/ftgasp.c"/>
36 <include name="freetype-2.4.10/src/base/ftgxval.c"/>
37 <include name="freetype-2.4.10/src/base/ftlcdfil.c"/>
38 <include name="freetype-2.4.10/src/base/ftmm.c"/>
39 <include name="freetype-2.4.10/src/base/ftotval.c"/>
40 <include name="freetype-2.4.10/src/base/ftpatent.c"/>
41 <include name="freetype-2.4.10/src/base/ftpfr.c"/>
42 <include name="freetype-2.4.10/src/base/ftstroke.c"/>
43 <include name="freetype-2.4.10/src/base/ftsynth.c"/>
44 <include name="freetype-2.4.10/src/base/fttype1.c"/>
45 <include name="freetype-2.4.10/src/base/ftwinfnt.c"/>
46 <include name="freetype-2.4.10/src/base/ftxf86.c"/>
47 <include name="freetype-2.4.10/src/bdf/bdf.c"/>
48 <include name="freetype-2.4.10/src/cff/cff.c"/>
49 <include name="freetype-2.4.10/src/cid/type1cid.c"/>
50 <include name="freetype-2.4.10/src/pcf/pcf.c"/>
51 <include name="freetype-2.4.10/src/pfr/pfr.c"/>
52 <include name="freetype-2.4.10/src/sfnt/sfnt.c"/>
53 <include name="freetype-2.4.10/src/truetype/truetype.c"/>
54 <include name="freetype-2.4.10/src/type1/type1.c"/>
55 <include name="freetype-2.4.10/src/type42/type42.c"/>
56 <include name="freetype-2.4.10/src/winfonts/winfnt.c"/>
57 <include name="freetype-2.4.10/src/raster/raster.c"/>
58 <include name="freetype-2.4.10/src/smooth/smooth.c"/>
59 <include name="freetype-2.4.10/src/autofit/autofit.c"/>
60 <include name="freetype-2.4.10/src/cache/ftcache.c"/>
61 <include name="freetype-2.4.10/src/gzip/ftgzip.c"/>
62 <include name="freetype-2.4.10/src/lzw/ftlzw.c"/>
63 <include name="freetype-2.4.10/src/bzip2/ftbzip2.c"/>
64 <include name="freetype-2.4.10/src/gxvalid/gxvalid.c"/>
65 <include name="freetype-2.4.10/src/otvalid/otvalid.c"/>
66 <include name="freetype-2.4.10/src/psaux/psaux.c"/>
67 <include name="freetype-2.4.10/src/pshinter/pshinter.c"/>
68 <include name="freetype-2.4.10/src/psnames/psnames.c"/>
73 <!-- define g++ compiler, options and files to compile -->
\r
74 <property name="g++" value="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"/>
\r
75 <property name="g++-opts" value="-c -Wall -O2 -miphoneos-version-min=5.1 -DFT2_BUILD_LIBRARY"/>
\r
76 <fileset id="g++-files" dir="./">
\r
77 <exclude name="target/"/>
\r
78 <include name="**/*.cpp"/>
83 <!-- define linker and options -->
\r
84 <property name="linker" value="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar"/>
\r
85 <property name="linker-opts" value="rcs"/>
\r
86 <property name="libraries" value=""/>
\r
88 <!-- cleans the build directory, removes all object files and shared libs -->
\r
89 <target name="clean">
\r
90 <delete includeemptydirs="true" quiet="true">
\r
91 <fileset dir="${buildDir}"/>
\r
92 <fileset dir="${libsDir}" includes="**/*" excludes="**/.svn"/>
\r
96 <target name="clean-objfiles">
\r
98 <fileset dir="${buildDir}">
\r
99 <include name="**/*.o"/>
\r
104 <target name="create-build-dir">
\r
105 <!-- FIXME this is pretty nasty :/ -->
\r
106 <copy todir="${buildDir}">
\r
107 <fileset refid="g++-files"/>
\r
108 <fileset refid="gcc-files"/>
\r
111 <fileset dir="${buildDir}">
\r
112 <include name="*"/>
\r
113 <exclude name="*.o"/>
\r
118 <!-- compiles all C and C++ files to object files in the build directory, for 386 builds-->
\r
119 <target name="compile-386" depends="clean,create-build-dir">
\r
120 <mkdir dir="${buildDir}"/>
\r
121 <apply failonerror="true" executable="${g++}" dest="${buildDir}" verbose="true">
\r
122 <arg line="-isysroot ${iphonesimulator-sdk} -arch i386 ${g++-opts}"/>
\r
123 <arg value="-Ijni-headers"/>
\r
124 <arg value="-Ijni-headers/${jniPlatform}"/>
\r
126 <arg value="-Ifreetype-2.4.10/include"/>
131 <fileset refid="g++-files"/>
\r
133 <mapper type="glob" from="*.cpp" to="*.o"/>
\r
134 <mapper type="glob" from="*.mm" to="*.o"/>
\r
137 <apply failonerror="true" executable="${gcc}" dest="${buildDir}" verbose="true">
\r
138 <arg line="-isysroot ${iphonesimulator-sdk} -arch i386 ${gcc-opts}"/>
\r
139 <arg value="-Ijni-headers"/>
\r
140 <arg value="-Ijni-headers/${jniPlatform}"/>
\r
142 <arg value="-Ifreetype-2.4.10/include"/>
147 <fileset refid="gcc-files"/>
\r
149 <mapper type="glob" from="*.c" to="*.o"/>
\r
154 <!-- links the shared library based on the previously compiled object files -->
\r
155 <target name="link-386" depends="compile-386">
\r
156 <fileset dir="${buildDir}" id="objFileSet">
\r
158 <include name="**/*.o" />
\r
161 <pathconvert pathsep=" " property="objFiles" refid="objFileSet" />
\r
162 <mkdir dir="${libsDir}" />
\r
163 <exec executable="${linker}" failonerror="true" dir="${buildDir}">
\r
164 <arg line="${linker-opts}" />
\r
165 <arg path="${libsDir}/${libName}.386" />
\r
166 <arg line="${objFiles}"/>
\r
167 <arg line="${libraries}" />
\r
171 <!-- compiles all C and C++ files to object files in the build directory, for 386 builds-->
\r
172 <target name="compile-arm" depends="create-build-dir,clean-objfiles">
\r
173 <mkdir dir="${buildDir}"/>
\r
174 <apply failonerror="true" executable="${g++}" dest="${buildDir}" verbose="true">
\r
175 <arg line="-isysroot ${iphoneos-sdk} -arch armv7 ${g++-opts}"/>
\r
176 <arg value="-Ijni-headers"/>
\r
177 <arg value="-Ijni-headers/${jniPlatform}"/>
\r
179 <arg value="-Ifreetype-2.4.10/include"/>
184 <fileset refid="g++-files"/>
\r
186 <mapper type="glob" from="*.cpp" to="*.o"/>
\r
187 <mapper type="glob" from="*.mm" to="*.o"/>
\r
190 <apply failonerror="true" executable="${gcc}" dest="${buildDir}" verbose="true">
\r
191 <arg line="-isysroot ${iphoneos-sdk} -arch armv7 ${gcc-opts}"/>
\r
192 <arg value="-Ijni-headers"/>
\r
193 <arg value="-Ijni-headers/${jniPlatform}"/>
\r
195 <arg value="-Ifreetype-2.4.10/include"/>
200 <fileset refid="gcc-files"/>
\r
202 <mapper type="glob" from="*.c" to="*.o"/>
\r
207 <!-- links the shared library based on the previously compiled object files -->
\r
208 <target name="link-arm" depends="compile-arm">
\r
209 <fileset dir="${buildDir}" id="objFileSet">
\r
211 <include name="**/*.o" />
\r
214 <pathconvert pathsep=" " property="objFiles" refid="objFileSet" />
\r
215 <mkdir dir="${libsDir}" />
\r
216 <exec executable="${linker}" failonerror="true" dir="${buildDir}">
\r
217 <arg line="${linker-opts}" />
\r
218 <arg path="${libsDir}/${libName}.armv7" />
\r
219 <arg line="${objFiles}"/>
\r
220 <arg line="${libraries}" />
\r
224 <target name="link-fat">
\r
225 <exec executable="lipo" failonerror="true" dir="${libsDir}">
\r
226 <arg line="-create -output ${libName} ${libName}.386 ${libName}.armv7"/>
\r
230 <target name="postcompile" depends="link-386,link-arm,link-fat">
\r