aboutsummaryrefslogtreecommitdiffstats
path: root/make/build-oculusvr.xml
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-06-20 06:36:08 +0200
committerSven Gothel <[email protected]>2014-06-20 06:36:08 +0200
commitb54e87d2cebf6aa0def18f172cbfa111c4efc837 (patch)
tree5f33e900872f28c2e71b129db67b3f2dca0e4b52 /make/build-oculusvr.xml
parent589070da2be7e097b7415503011387ad1f6e14d5 (diff)
Bug 1021: Add OculusSDK binding / Basic OVR support (Bring-up on Windows w/ Mingw64 ; Solve static linkage of stdc++)
- Bring-up on Windows w/ Mingw64 - Bumped oculusvr-sdk to commit 70e44b846ceaf9eebc336b12a07406c3a418a5c3 - Added required mingw64 linker statments - Builds and runs on x86_64 and i386 - Solve static linkage of stdc++ - "-Wl,-Bstatic -lstdc++ -Wl,-Bdynamic" MUST come AFTER all object files!! - No more manual '--undefined=symbol' required .. puhh :) - Cleanup linker cfg .. - Still runs on GNU/Linux x86_64 and i386
Diffstat (limited to 'make/build-oculusvr.xml')
-rw-r--r--make/build-oculusvr.xml173
1 files changed, 67 insertions, 106 deletions
diff --git a/make/build-oculusvr.xml b/make/build-oculusvr.xml
index a929a8fc7..3710185d4 100644
--- a/make/build-oculusvr.xml
+++ b/make/build-oculusvr.xml
@@ -94,8 +94,8 @@
<isset property="isLinuxX86"/>
<isset property="isLinuxAMD64"/>
<!-- isset property="isAndroid"/-->
- <!-- isset property="isWindowsX86"/-->
- <!-- isset property="isWindowsAMD64"/-->
+ <isset property="isWindowsX86"/>
+ <isset property="isWindowsAMD64"/>
<!-- isset property="isOSX"/-->
</or>
<not>
@@ -201,63 +201,6 @@
<!-- linker configuration -->
- <linker id="linker.cfg.freebsd.oculusvr.x11" extends="linker.cfg.freebsd">
- <syslibset dir="/usr/local/lib" libs="X11 Xrandr udev m"/>
- </linker>
-
- <linker id="linker.cfg.freebsd.amd64.oculusvr.x11" extends="linker.cfg.freebsd.amd64">
- <syslibset dir="/usr/local/lib" libs="X11 Xrandr udev m"/>
- </linker>
-
- <linker id="linker.cfg.linux.oculusvr.x11" extends="linker.cfg.linux">
- <syslibset libs="X11 Xrandr udev m"/>
- </linker>
-
- <linker id="linker.cfg.linux.x86.oculusvr.x11" extends="linker.cfg.linux.x86">
- <syslibset libs="X11 Xrandr udev m"/>
- </linker>
-
- <linker id="linker.cfg.linux.amd64.oculusvr.x11" extends="linker.cfg.linux.amd64">
- <syslibset libs="X11 Xrandr udev m"/>
- </linker>
-
- <linker id="linker.cfg.linux.armv6.oculusvr.x11" extends="linker.cfg.linux.armv6">
- <syslibset dir="${env.TARGET_PLATFORM_ROOT}/usr/lib" libs="X11 Xrandr udev m"/>
- </linker>
-
- <linker id="linker.cfg.android.oculusvr" extends="linker.cfg.android">
- </linker>
-
- <linker id="linker.cfg.solaris.oculusvr.x11" extends="linker.cfg.solaris">
- <syslibset libs="X11 Xrandr udev m"/>
- </linker>
-
- <linker id="linker.cfg.solaris.sparcv9.oculusvr.x11" extends="linker.cfg.solaris.sparcv9">
- <linkerarg value="-L/usr/lib/sparcv9"/>
- <syslibset libs="X11 Xrandr udev m"/>
- </linker>
-
- <linker id="linker.cfg.solaris.amd64.oculusvr.x11" extends="linker.cfg.solaris.amd64">
- <linkerarg value="-L/usr/lib/amd64"/>
- <syslibset libs="X11 Xrandr udev m"/>
- </linker>
-
- <linker id="linker.cfg.win32.mingw.oculusvr" extends="linker.cfg.win32.mingw">
- <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names -->
- <syslibset libs="gdi32, kernel32, strmiids, uuid, ole32, oleaut32"/> <!-- last 4 for dshow video input query! -->
- </linker>
-
- <linker id="linker.cfg.win64.mingw.oculusvr" extends="linker.cfg.win64.mingw">
- <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names -->
- <syslibset libs="gdi32, kernel32, strmiids, uuid, ole32, oleaut32"/> <!-- last 4 for dshow video input query! -->
- </linker>
-
- <linker id="linker.cfg.win32.msvc.oculusvr" extends="linker.cfg.win32.msvc">
- <syslibset libs="user32, kernel32" />
- <!-- This is temporary -->
- <syslibset libs="winmm" />
- </linker>
-
<linker id="linker.cfg.macosx.oculusvr" extends="linker.cfg.macosx">
<linkerarg value="-weak_framework" />
<linkerarg value="AppKit" />
@@ -269,88 +212,84 @@
<linkerarg value="OpenGL" /-->
</linker>
- <linker id="linker.cfg.hpux.oculusvr" extends="linker.cfg.hpux">
- <!-- syslibset dir="/opt/graphics/OpenGL/lib" libs="GL, GLU"/-->
- <syslibset dir="/usr/lib" libs="X11 Xrandr udev m"/>
- </linker>
</target>
<target name="c.configure.win32.vc" if="isVCFamily">
<echo message="Win32.VC" />
<property name="compiler.cfg.id" value="compiler.cfg.win32.msvc" />
- <property name="linker.cfg.id.os" value="linker.cfg.win32.msvc.oculusvr" />
+ <property name="linker.cfg.id.os" value="linker.cfg.win32.msvc" />
</target>
<target name="c.configure.win32.mingw" if="isMingW32">
<echo message="Win32.MingW" />
<property name="compiler.cfg.id" value="compiler.cfg.win32.mingw" />
- <property name="linker.cfg.id.os" value="linker.cfg.win32.mingw.oculusvr" />
+ <property name="linker.cfg.id.os" value="linker.cfg.win32.mingw" />
</target>
<target name="c.configure.win64.mingw" if="isMingW64">
<echo message="Win64.MingW" />
<property name="compiler.cfg.id" value="compiler.cfg.win64.mingw" />
- <property name="linker.cfg.id.os" value="linker.cfg.win64.mingw.oculusvr" />
+ <property name="linker.cfg.id.os" value="linker.cfg.win64.mingw" />
</target>
<target name="c.configure.linux.x86" if="isLinuxX86">
<echo message="Linux.x86" />
<property name="compiler.cfg.id" value="compiler.cfg.linux.x86" />
- <property name="linker.cfg.id.os" value="linker.cfg.linux.x86.oculusvr.x11" />
+ <property name="linker.cfg.id.os" value="linker.cfg.linux.x86" />
</target>
<target name="c.configure.linux.amd64" if="isLinuxAMD64">
<echo message="Linux.AMD64" />
<property name="compiler.cfg.id" value="compiler.cfg.linux.amd64" />
- <property name="linker.cfg.id.os" value="linker.cfg.linux.amd64.oculusvr.x11" />
+ <property name="linker.cfg.id.os" value="linker.cfg.linux.amd64" />
</target>
<target name="c.configure.linux.armv6" if="isLinuxARMv6">
<echo message="Linux.armv6" />
<property name="compiler.cfg.id" value="compiler.cfg.linux.armv6.oculusvr.x11" />
- <property name="linker.cfg.id.os" value="linker.cfg.linux.armv6.oculusvr.x11" />
+ <property name="linker.cfg.id.os" value="linker.cfg.linux.armv6" />
</target>
<target name="c.configure.linux.ia64" if="isLinuxIA64">
<echo message="Linux.IA64" />
<property name="compiler.cfg.id" value="compiler.cfg.linux" />
- <property name="linker.cfg.id.os" value="linker.cfg.linux.oculusvr.x11" />
+ <property name="linker.cfg.id.os" value="linker.cfg.linux" />
</target>
<target name="c.configure.linux.hppa" if="isLinuxHppa">
<echo message="Linux.HPPA" />
<property name="compiler.cfg.id" value="compiler.cfg.linux" />
- <property name="linker.cfg.id.os" value="linker.cfg.linux.oculusvr.x11" />
+ <property name="linker.cfg.id.os" value="linker.cfg.linux" />
</target>
<target name="c.configure.linux.mips" if="isLinuxMips">
<echo message="Linux.MIPS" />
<property name="compiler.cfg.id" value="compiler.cfg.linux" />
- <property name="linker.cfg.id.os" value="linker.cfg.linux.oculusvr.x11" />
+ <property name="linker.cfg.id.os" value="linker.cfg.linux" />
</target>
<target name="c.configure.linux.mipsel" if="isLinuxMipsel">
<echo message="Linux.MIPSEL" />
<property name="compiler.cfg.id" value="compiler.cfg.linux" />
- <property name="linker.cfg.id.os" value="linker.cfg.linux.oculusvr.x11" />
+ <property name="linker.cfg.id.os" value="linker.cfg.linux" />
</target>
<target name="c.configure.linux.ppc" if="isLinuxPpc">
<echo message="Linux.PPC" />
<property name="compiler.cfg.id" value="compiler.cfg.linux" />
- <property name="linker.cfg.id.os" value="linker.cfg.linux.oculusvr.x11" />
+ <property name="linker.cfg.id.os" value="linker.cfg.linux" />
</target>
<target name="c.configure.linux.s390" if="isLinuxs390">
<echo message="Linux.S390" />
<property name="compiler.cfg.id" value="compiler.cfg.linux" />
- <property name="linker.cfg.id.os" value="linker.cfg.linux.oculusvr.x11" />
+ <property name="linker.cfg.id.os" value="linker.cfg.linux" />
</target>
<target name="c.configure.linux.sparc" if="isLinuxSparc">
<echo message="Linux.SPARC" />
<property name="compiler.cfg.id" value="compiler.cfg.linux" />
- <property name="linker.cfg.id.os" value="linker.cfg.linux.oculusvr.x11" />
+ <property name="linker.cfg.id.os" value="linker.cfg.linux" />
</target>
<target name="c.configure.linux" depends="c.configure.linux.armv6,c.configure.linux.x86,c.configure.linux.amd64,c.configure.linux.ia64,c.configure.linux.hppa,c.configure.linux.mips,c.configure.linux.mipsel,c.configure.linux.ppc,c.configure.linux.s390,c.configure.linux.sparc,c.configure.x11" if="isLinux" />
@@ -358,39 +297,39 @@
<target name="c.configure.android" if="isAndroid">
<echo message="Android" />
<property name="compiler.cfg.id" value="compiler.cfg.android" />
- <property name="linker.cfg.id.os" value="linker.cfg.android.oculusvr" />
+ <property name="linker.cfg.id.os" value="linker.cfg.android" />
</target>
<target name="c.configure.solaris32" depends="c.configure.x11" if="isSolaris32Bit">
<echo message="Solaris" />
<property name="compiler.cfg.id" value="compiler.cfg.solaris" />
- <property name="linker.cfg.id.os" value="linker.cfg.solaris.oculusvr.x11" />
+ <property name="linker.cfg.id.os" value="linker.cfg.solarisx11" />
</target>
<target name="c.configure.solaris.sparcv9" depends="c.configure.x11" if="isSolarisSparcv9">
<echo message="SolarisSparcv9" />
<property name="compiler.cfg.id" value="compiler.cfg.solaris.sparcv9" />
- <property name="linker.cfg.id.os" value="linker.cfg.solaris.sparcv9.oculusvr.x11" />
+ <property name="linker.cfg.id.os" value="linker.cfg.solaris.sparcv9" />
</target>
<target name="c.configure.solaris.amd64" depends="c.configure.x11" if="isSolarisAMD64">
<echo message="SolarisAMD64" />
<property name="compiler.cfg.id" value="compiler.cfg.solaris.amd64" />
- <property name="linker.cfg.id.os" value="linker.cfg.solaris.amd64.oculusvr.x11" />
+ <property name="linker.cfg.id.os" value="linker.cfg.solaris.amd64" />
</target>
<target name="c.configure.freebsd.x86" depends="c.configure.x11" if="isFreeBSDX86">
<echo message="FreeBSD" />
<property name="compiler.cfg.id" value="compiler.cfg.freebsd.oculusvr" />
- <property name="linker.cfg.id.os" value="linker.cfg.freebsd.oculusvr.x11" />
+ <property name="linker.cfg.id.os" value="linker.cfg.freebsd" />
</target>
<target name="c.configure.freebsd.amd64" depends="c.configure.x11" if="isFreeBSDAMD64">
<echo message="FreeBSD" />
<property name="compiler.cfg.id" value="compiler.cfg.freebsd.oculusvr" />
- <property name="linker.cfg.id.os" value="linker.cfg.freebsd.amd64.oculusvr.x11" />
+ <property name="linker.cfg.id.os" value="linker.cfg.freebsd.amd64" />
</target>
<target name="c.configure.freebsd" depends="c.configure.freebsd.x86,c.configure.freebsd.amd64,c.configure.x11" if="isFreeBSD" />
@@ -398,7 +337,7 @@
<target name="c.configure.hpux" depends="c.configure.x11" if="isHPUX">
<echo message="HP-UX" />
<property name="compiler.cfg.id" value="compiler.cfg.hpux" />
- <property name="linker.cfg.id.os" value="linker.cfg.hpux.oculusvr.x11" />
+ <property name="linker.cfg.id.os" value="linker.cfg.hpux" />
</target>
<target name="c.configure.win32" depends="c.configure.win32.vc,c.configure.win32.mingw,c.configure.win64.mingw" if="isWindows" />
@@ -454,7 +393,6 @@
<include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_JSON.cpp"/>
<include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_LatencyTestImpl.cpp"/>
<include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Profile.cpp"/>
- <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Linux_SensorDevice.cpp"/>
<include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_SensorCalibration.cpp"/>
<include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_SensorFilter.cpp"/>
<include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_SensorFusion.cpp"/>
@@ -484,13 +422,28 @@
<include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Util/Util_LatencyTest.cpp"/>
<include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Util/Util_LatencyTest2.cpp"/>
<include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Util/Util_Render_Stereo.cpp"/>
- <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_ThreadsPthread.cpp"/>
- <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Linux_HIDDevice.cpp"/>
- <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Linux_SensorDevice.cpp"/>
- <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Linux_DeviceManager.cpp"/>
- <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Linux_HMDDevice.cpp"/>
<include name="${rootrel.oculusvr.sdk}/3rdParty/TinyXml/tinyxml2.cpp"/>
- <include name="${rootrel.oculusvr.sdk}/3rdParty/EDID/edid.cpp"/>
+
+ <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_ThreadsPthread.cpp" if="isLinux"/>
+ <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Linux_HIDDevice.cpp" if="isLinux"/>
+ <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Linux_SensorDevice.cpp" if="isLinux"/>
+ <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Linux_DeviceManager.cpp" if="isLinux"/>
+ <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Linux_HMDDevice.cpp" if="isLinux"/>
+ <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Linux_SensorDevice.cpp" if="isLinux"/>
+ <include name="${rootrel.oculusvr.sdk}/3rdParty/EDID/edid.cpp" if="isLinux"/>
+
+ <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_ThreadsWinAPI.cpp" if="isWindows"/>
+ <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Win32_DeviceManager.cpp" if="isWindows"/>
+ <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Win32_DeviceStatus.cpp" if="isWindows"/>
+ <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Win32_HIDDevice.cpp" if="isWindows"/>
+ <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Win32_HMDDevice.cpp" if="isWindows"/>
+ <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Win32_SensorDevice.cpp" if="isWindows"/>
+
+ <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_ThreadsPthread.cpp" if="isOSX"/>
+ <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_OSX_DeviceManager.cpp" if="isOSX"/>
+ <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_OSX_HIDDevice.cpp" if="isOSX"/>
+ <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_OSX_HMDDevice.cpp" if="isOSX"/>
+ <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_OSX_SensorDevice.cpp" if="isOSX"/>
</patternset>
<echo message="Compiling @{output.lib.name}" />
@@ -532,25 +485,33 @@
<includepath path="${src.generated.c}" />
<compilerarg value="-fno-rtti"/>
+
+ <compilerarg value="-municode" if="isMingW"/>
+ <compilerarg value="-DUNICODE" if="isMingW"/>
+ <compilerarg value="-D_UNICODE" if="isMingW"/>
</compiler>
<linker extends="@{linker.cfg.id}">
- <linkerarg value="-Wl,-Bstatic" if="isGCC"/>
- <!-- linkerarg value="-Wl,-whole-archive" if="isGCC"/-->
- <linkerarg value="-Wl,--undefined=__cxa_pure_virtual" if="isGCC"/>
- <linkerarg value="-Wl,--undefined=__cxa_guard_release" if="isGCC"/>
- <linkerarg value="-Wl,--undefined=__cxa_guard_abort" if="isGCC"/>
- <linkerarg value="-Wl,--undefined=__cxa_guard_acquire" if="isGCC"/>
- <linkerarg value="-Wl,--undefined=__gxx_personality_v0" if="isGCC"/>
- <linkerarg value="-Wl,--undefined=_ZdaPv" if="isGCC"/>
- <linkerarg value="-Wl,--undefined=_Znwm" if="isGCC"/>
- <linkerarg value="-Wl,--undefined=_Znam" if="isGCC"/>
- <linkerarg value="-Wl,--undefined=_Znaj" if="isGCC"/>
- <linkerarg value="-Wl,--undefined=_Znwj" if="isGCC"/>
- <linkerarg value="-lstdc++" />
- <!-- linkerarg value="-Wl,-no-whole-archive" if="isGCC"/-->
- <linkerarg value="-Wl,-Bdynamic" if="isGCC"/>
- <!-- syslibset libs="stdc++"/ -->
+ <syslibset libs="setupapi, winmm" if="isWindows"/>
+ <syslibset libs="gdi32, kernel32" if="isWindows"/>
+
+ <syslibset libs="X11 Xrandr udev m" if="isLinux" unless="isLinuxARMv6" />
+ <syslibset dir="${env.TARGET_PLATFORM_ROOT}/usr/lib"
+ libs="X11 Xrandr udev m" if="isLinuxARMv6" />
+
+ <syslibset dir="/usr/local/lib" libs="X11 Xrandr udev m" if="isFreeBSD"/>
+ <syslibset dir="/usr/lib" libs="X11 Xrandr udev m" if="isHPUX"/>
+ <syslibset dir="/usr/lib/amd64" libs="X11 Xrandr udev m" if="isSolaris32Bit"/>
+ <syslibset dir="/usr/lib/amd64" libs="X11 Xrandr udev m" if="isSolarisAMD64"/>
+ <syslibset dir="/usr/lib/sparcv9" libs="X11 Xrandr udev m" if="isSolarisSparcv9"/>
+
+ <!-- syslibset libs="stdc++"
+ Don't link dynamic
+ Static link directive must be at the end! -->
+ <linkerarg location="end" value="-Wl,-Bstatic" if="isGCC"/>
+ <linkerarg location="end" value="-lstdc++" />
+ <linkerarg location="end" value="-Wl,-Bdynamic" if="isGCC"/>
+
</linker>
</cc>