move vtm/jni to separate c project
This commit is contained in:
1 parent
c16ffef0bd
commit
3630155ad0
45 files changed
+645
-2
No files matched your search
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="cdt.managedbuild.toolchain.gnu.base.1587393048">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.1587393048" moduleId="org.eclipse.cdt.core.settings" name="Default">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration buildProperties="" id="cdt.managedbuild.toolchain.gnu.base.1587393048" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
|
||||
<folderInfo id="cdt.managedbuild.toolchain.gnu.base.1587393048.116574534" name="/" resourcePath="">
|
||||
<toolChain id="cdt.managedbuild.toolchain.gnu.base.223412825" name="cdt.managedbuild.toolchain.gnu.base" superClass="cdt.managedbuild.toolchain.gnu.base">
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.385578518" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
|
||||
<builder id="cdt.managedbuild.target.gnu.builder.base.156937647" managedBuildOn="false" name="Gnu Make Builder.Default" superClass="cdt.managedbuild.target.gnu.builder.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1823835369" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.360207042" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.1095290162" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.335083411" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.1727739418" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.assembler.base.2019534622" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="vtm-jni.null.1777174385" name="vtm-jni"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
</cproject>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>vtm-jni</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,26 @@
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := vtm-jni
|
||||
LOCAL_C_INCLUDES := .
|
||||
|
||||
LOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%) -O2 -Wall -D__ANDROID__ -Wall -std=c99 -O2 -ffast-math
|
||||
LOCAL_CPPFLAGS := $(LOCAL_C_INCLUDES:%=-I%) -O2 -Wall -D__ANDROID__ -Wall -std=c99 -O2 -ffast-math
|
||||
LOCAL_LDLIBS := -lm -llog
|
||||
LOCAL_ARM_MODE := arm
|
||||
|
||||
LOCAL_SRC_FILES := gl/utils.c\
|
||||
tessellate/TessellateJni.c\
|
||||
tessellate/render.c\
|
||||
tessellate/memalloc.c\
|
||||
tessellate/geom.c\
|
||||
tessellate/dict.c\
|
||||
tessellate/tessmono.c\
|
||||
tessellate/normal.c\
|
||||
tessellate/tessellate.c\
|
||||
tessellate/mesh.c\
|
||||
tessellate/tess.c\
|
||||
tessellate/priorityq.c\
|
||||
tessellate/sweep.c
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
@@ -0,0 +1 @@
|
||||
APP_ABI := armeabi armeabi-v7a x86
|
||||
@@ -0,0 +1,33 @@
|
||||
<project name="android-natives" basedir="." default="postcompile">
|
||||
<property environment="env" />
|
||||
<!-- the suffix ndk-build executable -->
|
||||
<property name="ndkSuffix" value="" />
|
||||
|
||||
<target name="clean" depends="check-for-ndk" if="has-ndk-build">
|
||||
<exec executable="${env.NDK_HOME}/ndk-build${ndkSuffix}" failonerror="true">
|
||||
<arg value="clean"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="precompile" depends="check-for-ndk">
|
||||
|
||||
</target>
|
||||
|
||||
<target name="compile-natives" depends="precompile" if="has-ndk-build">
|
||||
<echo>ndk_home: ${env.NDK_HOME}</echo>
|
||||
<exec executable="${env.NDK_HOME}/ndk-build${ndkSuffix}" failonerror="true"/>
|
||||
</target>
|
||||
|
||||
<target name="postcompile" depends="compile-natives">
|
||||
|
||||
</target>
|
||||
|
||||
<target name="check-for-ndk">
|
||||
<condition property="ndk-build-found">
|
||||
<available file="ndk-build${ndkSuffix}" filepath="${env.NDK_HOME}"/>
|
||||
</condition>
|
||||
<condition property="has-ndk-build">
|
||||
<equals arg1="${ndk-build-found}" arg2="true"/>
|
||||
</condition>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,156 @@
|
||||
<project name="vtm-jni-Linux-64" basedir="." default="postcompile">
|
||||
<!-- include the environment -->
|
||||
<property environment="env"/>
|
||||
<!-- output directory for temporary object files -->
|
||||
<property name="buildDir" value="target/linux64" />
|
||||
<!-- output directory for the shared library -->
|
||||
<property name="libsDir" value="../libs/linux64" />
|
||||
<!-- the name of the shared library -->
|
||||
<property name="libName" value="libvtm-jni64.so"/>
|
||||
<!-- the jni header jniPlatform to use -->
|
||||
<property name="jniPlatform" value="linux"/>
|
||||
<!-- the compilerPrefix for the C & C++ compilers -->
|
||||
<property name="compilerPrefix" value=""/>
|
||||
<!-- the compilerSuffix for the C & C++ compilers -->
|
||||
<property name="compilerSuffix" value="" />
|
||||
|
||||
<!-- define gcc compiler, options and files to compile -->
|
||||
<property name="gcc" value="${compilerPrefix}gcc${compilerSuffix}"/>
|
||||
<property name="gcc-opts" value="-c -Wall -O2 -mfpmath=sse -msse -fmessage-length=0 -m64 -fPIC -Wall -std=c99 -O2 -ffast-math"/>
|
||||
<fileset id="gcc-files" dir="./">
|
||||
<exclude name="target/"/>
|
||||
<include name="memcpy_wrap.c"/>
|
||||
<include name="gl/utils.c"/>
|
||||
<include name="tessellate/dict.c"/>
|
||||
<include name="tessellate/mesh.c"/>
|
||||
<include name="tessellate/render.c"/>
|
||||
<include name="tessellate/tess.c"/>
|
||||
<include name="tessellate/geom.c"/>
|
||||
<include name="tessellate/memalloc.c"/>
|
||||
<include name="tessellate/normal.c"/>
|
||||
<include name="tessellate/priorityq.c"/>
|
||||
<include name="tessellate/sweep.c"/>
|
||||
<include name="tessellate/tessmono.c"/>
|
||||
<include name="tessellate/tessellate.c"/>
|
||||
<include name="tessellate/TessellateJni.c"/>
|
||||
|
||||
|
||||
</fileset>
|
||||
|
||||
<!-- define g++ compiler, options and files to compile -->
|
||||
<property name="g++" value="${compilerPrefix}g++${compilerSuffix}"/>
|
||||
<property name="g++-opts" value="-c -Wall -O2 -mfpmath=sse -msse -fmessage-length=0 -m64 -fPIC -Wall -std=c99 -O2 -ffast-math"/>
|
||||
<fileset id="g++-files" dir="./">
|
||||
<exclude name="target/"/>
|
||||
<include name="**/*.cpp"/>
|
||||
|
||||
|
||||
</fileset>
|
||||
|
||||
<!-- define linker and options -->
|
||||
<property name="linker" value="${compilerPrefix}g++${compilerSuffix}"/>
|
||||
<property name="linker-opts" value="-shared -m64 -Wl,-wrap,memcpy"/>
|
||||
<property name="libraries" value=""/>
|
||||
|
||||
<!-- cleans the build directory, removes all object files and shared libs -->
|
||||
<target name="clean">
|
||||
<delete includeemptydirs="true" quiet="true">
|
||||
<fileset dir="${buildDir}"/>
|
||||
<fileset dir="${libsDir}" includes="**/*" excludes="**/.svn"/>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<target name="precompile">
|
||||
<condition property="compiler-found">
|
||||
<and>
|
||||
<or>
|
||||
<!-- Include both b/c Windows might be either -->
|
||||
<available file="${g++}" filepath="${env.PATH}"/>
|
||||
<available file="${g++}" filepath="${env.Path}"/>
|
||||
</or>
|
||||
<or>
|
||||
<!-- Include both b/c Windows might be either -->
|
||||
<available file="${gcc}" filepath="${env.PATH}"/>
|
||||
<available file="${gcc}" filepath="${env.Path}"/>
|
||||
</or>
|
||||
</and>
|
||||
</condition>
|
||||
<condition property="has-compiler">
|
||||
<equals arg1="${compiler-found}" arg2="true"/>
|
||||
</condition>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="create-build-dir" depends="precompile" if="has-compiler">
|
||||
<!-- FIXME this is pretty nasty :/ -->
|
||||
<copy todir="${buildDir}">
|
||||
<fileset refid="g++-files"/>
|
||||
<fileset refid="gcc-files"/>
|
||||
</copy>
|
||||
<delete>
|
||||
<fileset dir="${buildDir}">
|
||||
<include name="*"/>
|
||||
<exclude name="*.o"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<!-- compiles all C and C++ files to object files in the build directory -->
|
||||
<target name="compile" depends="create-build-dir" if="has-compiler">
|
||||
<mkdir dir="${buildDir}"/>
|
||||
<apply failonerror="true" executable="${g++}" dest="${buildDir}" verbose="true">
|
||||
<arg line="${g++-opts}"/>
|
||||
<arg value="-Ijni-headers"/>
|
||||
<arg value="-Ijni-headers/${jniPlatform}"/>
|
||||
<arg value="-I."/>
|
||||
<arg value="-I."/>
|
||||
|
||||
<srcfile/>
|
||||
<arg value="-o"/>
|
||||
<targetfile/>
|
||||
<fileset refid="g++-files"/>
|
||||
<compositemapper>
|
||||
<mapper type="glob" from="*.cpp" to="*.o"/>
|
||||
<mapper type="glob" from="*.mm" to="*.o"/>
|
||||
</compositemapper>
|
||||
</apply>
|
||||
<apply failonerror="true" executable="${gcc}" dest="${buildDir}" verbose="true">
|
||||
<arg line="${gcc-opts}"/>
|
||||
<arg value="-Ijni-headers"/>
|
||||
<arg value="-Ijni-headers/${jniPlatform}"/>
|
||||
<arg value="-I."/>
|
||||
<arg value="-I."/>
|
||||
|
||||
<srcfile/>
|
||||
<arg value="-o"/>
|
||||
<targetfile/>
|
||||
<fileset refid="gcc-files"/>
|
||||
<compositemapper>
|
||||
<mapper type="glob" from="*.c" to="*.o"/>
|
||||
<mapper type="glob" from="*.m" to="*.o"/>
|
||||
</compositemapper>
|
||||
</apply>
|
||||
</target>
|
||||
|
||||
<!-- links the shared library based on the previously compiled object files -->
|
||||
<target name="link" depends="compile" if="has-compiler">
|
||||
<fileset dir="${buildDir}" id="objFileSet">
|
||||
<patternset>
|
||||
<include name="**/*.o" />
|
||||
</patternset>
|
||||
</fileset>
|
||||
<pathconvert pathsep=" " property="objFiles" refid="objFileSet" />
|
||||
<mkdir dir="${libsDir}" />
|
||||
<exec executable="${linker}" failonerror="true" dir="${buildDir}">
|
||||
<arg line="${linker-opts}" />
|
||||
<arg value="-o" />
|
||||
<arg path="${libsDir}/${libName}" />
|
||||
<arg line="${objFiles}"/>
|
||||
<arg line="${libraries}" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="postcompile" depends="link">
|
||||
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,156 @@
|
||||
<project name="vtm-jni-Windows-32" basedir="." default="postcompile">
|
||||
<!-- include the environment -->
|
||||
<property environment="env"/>
|
||||
<!-- output directory for temporary object files -->
|
||||
<property name="buildDir" value="target/windows32" />
|
||||
<!-- output directory for the shared library -->
|
||||
<property name="libsDir" value="../libs/windows32" />
|
||||
<!-- the name of the shared library -->
|
||||
<property name="libName" value="vtm-jni.dll"/>
|
||||
<!-- the jni header jniPlatform to use -->
|
||||
<property name="jniPlatform" value="win32"/>
|
||||
<!-- the compilerPrefix for the C & C++ compilers -->
|
||||
<property name="compilerPrefix" value="i686-w64-mingw32-"/>
|
||||
<!-- the compilerSuffix for the C & C++ compilers -->
|
||||
<property name="compilerSuffix" value="" />
|
||||
|
||||
<!-- define gcc compiler, options and files to compile -->
|
||||
<property name="gcc" value="${compilerPrefix}gcc${compilerSuffix}"/>
|
||||
<property name="gcc-opts" value="-c -Wall -O2 -mfpmath=sse -msse2 -fmessage-length=0 -m32 -Wall -std=c99 -O2 -ffast-math"/>
|
||||
<fileset id="gcc-files" dir="./">
|
||||
<exclude name="target/"/>
|
||||
<include name="memcpy_wrap.c"/>
|
||||
<include name="gl/utils.c"/>
|
||||
<include name="tessellate/dict.c"/>
|
||||
<include name="tessellate/mesh.c"/>
|
||||
<include name="tessellate/render.c"/>
|
||||
<include name="tessellate/tess.c"/>
|
||||
<include name="tessellate/geom.c"/>
|
||||
<include name="tessellate/memalloc.c"/>
|
||||
<include name="tessellate/normal.c"/>
|
||||
<include name="tessellate/priorityq.c"/>
|
||||
<include name="tessellate/sweep.c"/>
|
||||
<include name="tessellate/tessmono.c"/>
|
||||
<include name="tessellate/tessellate.c"/>
|
||||
<include name="tessellate/TessellateJni.c"/>
|
||||
|
||||
|
||||
</fileset>
|
||||
|
||||
<!-- define g++ compiler, options and files to compile -->
|
||||
<property name="g++" value="${compilerPrefix}g++${compilerSuffix}"/>
|
||||
<property name="g++-opts" value="-c -Wall -O2 -mfpmath=sse -msse2 -fmessage-length=0 -m32 -Wall -std=c99 -O2 -ffast-math"/>
|
||||
<fileset id="g++-files" dir="./">
|
||||
<exclude name="target/"/>
|
||||
<include name="**/*.cpp"/>
|
||||
|
||||
|
||||
</fileset>
|
||||
|
||||
<!-- define linker and options -->
|
||||
<property name="linker" value="${compilerPrefix}g++${compilerSuffix}"/>
|
||||
<property name="linker-opts" value="-Wl,--kill-at -shared -m32 -static-libgcc -static-libstdc++"/>
|
||||
<property name="libraries" value=""/>
|
||||
|
||||
<!-- cleans the build directory, removes all object files and shared libs -->
|
||||
<target name="clean">
|
||||
<delete includeemptydirs="true" quiet="true">
|
||||
<fileset dir="${buildDir}"/>
|
||||
<fileset dir="${libsDir}" includes="**/*" excludes="**/.svn"/>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<target name="precompile">
|
||||
<condition property="compiler-found">
|
||||
<and>
|
||||
<or>
|
||||
<!-- Include both b/c Windows might be either -->
|
||||
<available file="${g++}" filepath="${env.PATH}"/>
|
||||
<available file="${g++}" filepath="${env.Path}"/>
|
||||
</or>
|
||||
<or>
|
||||
<!-- Include both b/c Windows might be either -->
|
||||
<available file="${gcc}" filepath="${env.PATH}"/>
|
||||
<available file="${gcc}" filepath="${env.Path}"/>
|
||||
</or>
|
||||
</and>
|
||||
</condition>
|
||||
<condition property="has-compiler">
|
||||
<equals arg1="${compiler-found}" arg2="true"/>
|
||||
</condition>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="create-build-dir" depends="precompile" if="has-compiler">
|
||||
<!-- FIXME this is pretty nasty :/ -->
|
||||
<copy todir="${buildDir}">
|
||||
<fileset refid="g++-files"/>
|
||||
<fileset refid="gcc-files"/>
|
||||
</copy>
|
||||
<delete>
|
||||
<fileset dir="${buildDir}">
|
||||
<include name="*"/>
|
||||
<exclude name="*.o"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<!-- compiles all C and C++ files to object files in the build directory -->
|
||||
<target name="compile" depends="create-build-dir" if="has-compiler">
|
||||
<mkdir dir="${buildDir}"/>
|
||||
<apply failonerror="true" executable="${g++}" dest="${buildDir}" verbose="true">
|
||||
<arg line="${g++-opts}"/>
|
||||
<arg value="-Ijni-headers"/>
|
||||
<arg value="-Ijni-headers/${jniPlatform}"/>
|
||||
<arg value="-I."/>
|
||||
<arg value="-I."/>
|
||||
|
||||
<srcfile/>
|
||||
<arg value="-o"/>
|
||||
<targetfile/>
|
||||
<fileset refid="g++-files"/>
|
||||
<compositemapper>
|
||||
<mapper type="glob" from="*.cpp" to="*.o"/>
|
||||
<mapper type="glob" from="*.mm" to="*.o"/>
|
||||
</compositemapper>
|
||||
</apply>
|
||||
<apply failonerror="true" executable="${gcc}" dest="${buildDir}" verbose="true">
|
||||
<arg line="${gcc-opts}"/>
|
||||
<arg value="-Ijni-headers"/>
|
||||
<arg value="-Ijni-headers/${jniPlatform}"/>
|
||||
<arg value="-I."/>
|
||||
<arg value="-I."/>
|
||||
|
||||
<srcfile/>
|
||||
<arg value="-o"/>
|
||||
<targetfile/>
|
||||
<fileset refid="gcc-files"/>
|
||||
<compositemapper>
|
||||
<mapper type="glob" from="*.c" to="*.o"/>
|
||||
<mapper type="glob" from="*.m" to="*.o"/>
|
||||
</compositemapper>
|
||||
</apply>
|
||||
</target>
|
||||
|
||||
<!-- links the shared library based on the previously compiled object files -->
|
||||
<target name="link" depends="compile" if="has-compiler">
|
||||
<fileset dir="${buildDir}" id="objFileSet">
|
||||
<patternset>
|
||||
<include name="**/*.o" />
|
||||
</patternset>
|
||||
</fileset>
|
||||
<pathconvert pathsep=" " property="objFiles" refid="objFileSet" />
|
||||
<mkdir dir="${libsDir}" />
|
||||
<exec executable="${linker}" failonerror="true" dir="${buildDir}">
|
||||
<arg line="${linker-opts}" />
|
||||
<arg value="-o" />
|
||||
<arg path="${libsDir}/${libName}" />
|
||||
<arg line="${objFiles}"/>
|
||||
<arg line="${libraries}" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="postcompile" depends="link">
|
||||
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,156 @@
|
||||
<project name="vtm-jni-Windows-64" basedir="." default="postcompile">
|
||||
<!-- include the environment -->
|
||||
<property environment="env"/>
|
||||
<!-- output directory for temporary object files -->
|
||||
<property name="buildDir" value="target/windows64" />
|
||||
<!-- output directory for the shared library -->
|
||||
<property name="libsDir" value="../libs/windows64" />
|
||||
<!-- the name of the shared library -->
|
||||
<property name="libName" value="vtm-jni64.dll"/>
|
||||
<!-- the jni header jniPlatform to use -->
|
||||
<property name="jniPlatform" value="win32"/>
|
||||
<!-- the compilerPrefix for the C & C++ compilers -->
|
||||
<property name="compilerPrefix" value="x86_64-w64-mingw32-"/>
|
||||
<!-- the compilerSuffix for the C & C++ compilers -->
|
||||
<property name="compilerSuffix" value="" />
|
||||
|
||||
<!-- define gcc compiler, options and files to compile -->
|
||||
<property name="gcc" value="${compilerPrefix}gcc${compilerSuffix}"/>
|
||||
<property name="gcc-opts" value="-c -Wall -O2 -mfpmath=sse -msse2 -fmessage-length=0 -m64 -Wall -std=c99 -O2 -ffast-math"/>
|
||||
<fileset id="gcc-files" dir="./">
|
||||
<exclude name="target/"/>
|
||||
<include name="memcpy_wrap.c"/>
|
||||
<include name="gl/utils.c"/>
|
||||
<include name="tessellate/dict.c"/>
|
||||
<include name="tessellate/mesh.c"/>
|
||||
<include name="tessellate/render.c"/>
|
||||
<include name="tessellate/tess.c"/>
|
||||
<include name="tessellate/geom.c"/>
|
||||
<include name="tessellate/memalloc.c"/>
|
||||
<include name="tessellate/normal.c"/>
|
||||
<include name="tessellate/priorityq.c"/>
|
||||
<include name="tessellate/sweep.c"/>
|
||||
<include name="tessellate/tessmono.c"/>
|
||||
<include name="tessellate/tessellate.c"/>
|
||||
<include name="tessellate/TessellateJni.c"/>
|
||||
|
||||
|
||||
</fileset>
|
||||
|
||||
<!-- define g++ compiler, options and files to compile -->
|
||||
<property name="g++" value="${compilerPrefix}g++${compilerSuffix}"/>
|
||||
<property name="g++-opts" value="-c -Wall -O2 -mfpmath=sse -msse2 -fmessage-length=0 -m64 -Wall -std=c99 -O2 -ffast-math"/>
|
||||
<fileset id="g++-files" dir="./">
|
||||
<exclude name="target/"/>
|
||||
<include name="**/*.cpp"/>
|
||||
|
||||
|
||||
</fileset>
|
||||
|
||||
<!-- define linker and options -->
|
||||
<property name="linker" value="${compilerPrefix}g++${compilerSuffix}"/>
|
||||
<property name="linker-opts" value="-Wl,--kill-at -shared -static-libgcc -static-libstdc++ -m64"/>
|
||||
<property name="libraries" value=""/>
|
||||
|
||||
<!-- cleans the build directory, removes all object files and shared libs -->
|
||||
<target name="clean">
|
||||
<delete includeemptydirs="true" quiet="true">
|
||||
<fileset dir="${buildDir}"/>
|
||||
<fileset dir="${libsDir}" includes="**/*" excludes="**/.svn"/>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<target name="precompile">
|
||||
<condition property="compiler-found">
|
||||
<and>
|
||||
<or>
|
||||
<!-- Include both b/c Windows might be either -->
|
||||
<available file="${g++}" filepath="${env.PATH}"/>
|
||||
<available file="${g++}" filepath="${env.Path}"/>
|
||||
</or>
|
||||
<or>
|
||||
<!-- Include both b/c Windows might be either -->
|
||||
<available file="${gcc}" filepath="${env.PATH}"/>
|
||||
<available file="${gcc}" filepath="${env.Path}"/>
|
||||
</or>
|
||||
</and>
|
||||
</condition>
|
||||
<condition property="has-compiler">
|
||||
<equals arg1="${compiler-found}" arg2="true"/>
|
||||
</condition>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="create-build-dir" depends="precompile" if="has-compiler">
|
||||
<!-- FIXME this is pretty nasty :/ -->
|
||||
<copy todir="${buildDir}">
|
||||
<fileset refid="g++-files"/>
|
||||
<fileset refid="gcc-files"/>
|
||||
</copy>
|
||||
<delete>
|
||||
<fileset dir="${buildDir}">
|
||||
<include name="*"/>
|
||||
<exclude name="*.o"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<!-- compiles all C and C++ files to object files in the build directory -->
|
||||
<target name="compile" depends="create-build-dir" if="has-compiler">
|
||||
<mkdir dir="${buildDir}"/>
|
||||
<apply failonerror="true" executable="${g++}" dest="${buildDir}" verbose="true">
|
||||
<arg line="${g++-opts}"/>
|
||||
<arg value="-Ijni-headers"/>
|
||||
<arg value="-Ijni-headers/${jniPlatform}"/>
|
||||
<arg value="-I."/>
|
||||
<arg value="-I."/>
|
||||
|
||||
<srcfile/>
|
||||
<arg value="-o"/>
|
||||
<targetfile/>
|
||||
<fileset refid="g++-files"/>
|
||||
<compositemapper>
|
||||
<mapper type="glob" from="*.cpp" to="*.o"/>
|
||||
<mapper type="glob" from="*.mm" to="*.o"/>
|
||||
</compositemapper>
|
||||
</apply>
|
||||
<apply failonerror="true" executable="${gcc}" dest="${buildDir}" verbose="true">
|
||||
<arg line="${gcc-opts}"/>
|
||||
<arg value="-Ijni-headers"/>
|
||||
<arg value="-Ijni-headers/${jniPlatform}"/>
|
||||
<arg value="-I."/>
|
||||
<arg value="-I."/>
|
||||
|
||||
<srcfile/>
|
||||
<arg value="-o"/>
|
||||
<targetfile/>
|
||||
<fileset refid="gcc-files"/>
|
||||
<compositemapper>
|
||||
<mapper type="glob" from="*.c" to="*.o"/>
|
||||
<mapper type="glob" from="*.m" to="*.o"/>
|
||||
</compositemapper>
|
||||
</apply>
|
||||
</target>
|
||||
|
||||
<!-- links the shared library based on the previously compiled object files -->
|
||||
<target name="link" depends="compile" if="has-compiler">
|
||||
<fileset dir="${buildDir}" id="objFileSet">
|
||||
<patternset>
|
||||
<include name="**/*.o" />
|
||||
</patternset>
|
||||
</fileset>
|
||||
<pathconvert pathsep=" " property="objFiles" refid="objFileSet" />
|
||||
<mkdir dir="${libsDir}" />
|
||||
<exec executable="${linker}" failonerror="true" dir="${buildDir}">
|
||||
<arg line="${linker-opts}" />
|
||||
<arg value="-o" />
|
||||
<arg path="${libsDir}/${libName}" />
|
||||
<arg line="${objFiles}"/>
|
||||
<arg line="${libraries}" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="postcompile" depends="link">
|
||||
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,28 @@
|
||||
<project name="vtm-jni-natives" basedir="." default="all">
|
||||
<target name="clean">
|
||||
<ant antfile="build-windows32.xml" target="clean"/>
|
||||
<ant antfile="build-windows64.xml" target="clean"/>
|
||||
<ant antfile="build-linux64.xml" target="clean"/>
|
||||
<ant antfile="build-android32.xml" target="clean"/>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="compile-natives">
|
||||
<ant antfile="build-windows32.xml"/>
|
||||
<ant antfile="build-windows64.xml"/>
|
||||
<ant antfile="build-linux64.xml"/>
|
||||
<ant antfile="build-android32.xml"/>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="pack-natives">
|
||||
<jar destfile="../libs/vtm-jni-natives.jar">
|
||||
<fileset dir="../libs/windows32" includes="vtm-jni.dll"/>
|
||||
<fileset dir="../libs/windows64" includes="vtm-jni64.dll"/>
|
||||
<fileset dir="../libs/linux64" includes="libvtm-jni64.so"/>
|
||||
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<target name="all" depends="compile-natives,pack-natives"/>
|
||||
</project>
|
||||
File renamed without changes.
@@ -8,8 +8,8 @@
|
||||
|
||||
#ifndef __WIN32__
|
||||
#include <alloca.h>
|
||||
#else
|
||||
#define alloca(size) __builtin_alloca(size)
|
||||
//#else
|
||||
//#define alloca(size) __builtin_alloca(size)
|
||||
#endif
|
||||
|
||||
//#ifndef uintptr_t
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef __ANDROID__
|
||||
#ifdef __linux__
|
||||
#ifdef __x86_64__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
|
||||
|
||||
void *__wrap_memcpy(void * destination, const void * source, size_t num)
|
||||
{
|
||||
return memcpy(destination, source, num);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user