Skip to content
Permalink
Browse files

Make Mumble and Murmur build on Windows/amd64.

  • Loading branch information...
mkrautz committed Jul 13, 2014
1 parent 50206ce commit c31269ad6783d82084dac24d104715e09229856d
Showing with 67 additions and 6 deletions.
  1. +40 −1 compiler.pri
  2. +7 −0 overlay/lib.cpp
  3. +2 −3 overlay/overlay.pro
  4. +6 −0 src/mumble/GlobalShortcut_win.cpp
  5. +4 −0 src/mumble/Overlay_win.cpp
  6. +1 −1 src/mumble/mumble.pro
  7. +7 −1 src/murmur/murmur.pro
@@ -9,6 +9,42 @@ win32 {
INCLUDEPATH *= "$$BOOST_PATH/include" "$$BOOST_PATH/include/boost-1_49/"
QMAKE_LIBDIR *= "$$OPENSSL_PATH/lib" "$$LIBSNDFILE_PATH/lib" "$$BOOST_PATH/lib"
INCLUDEPATH *= "$$OPENSSL_PATH/include" "$$LIBSNDFILE_PATH/include"

# Sanity check that DXSDK_DIR, LIB and INCLUDE are properly set up.
#
# On Windows/x86, we build using the VS2013 v120_xp toolchain, which targets
# a slightly modified Win7 SDK that still allows building for Windows XP. In that
# environment, we must use the "external" DirectX SDK (June 2010). This SDK is
# specified via the SXSDK_DIR.
#
# On Windows/amd64, we build using the VS2013 v120 platform, and we target the
# Windows 8.1 SDK. In this setup, we use the DirectX SDK included with the Windows
# 8.1 SDK, but only to a point. The bundled SDK does not include all things that
# we depend on for the overlay, such as d3dx{9,10,11}. To overcome this, we use
# both SDKs: the one bundled with the Windows 8.1 SDK for most libraries, and the
# external June 2010 variant for the things that are not in the Windows 8.1 SDK
# variant of the DirectX SDK. This is the approach recommended by Microsoft:
# http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275(v=vs.85).aspx
# (see step 5).
#
# Because of these things, the Windows build currently expects the build environment
# to properly set up the LIB and INCLUDE environment variables, with correct ordering
# of the Windows SDK and DirectX depending on the platform we're targetting.
# It's tough to check these things with qmake, we'll have to do with a simple sanity
# check for the presence of the variables.
DXSDK_DIR_VAR=$$(DXSDK_DIR)
INCLUDE_VAR=$$(INCLUDE)
LIB_VAR=$$(LIB)
isEmpty(DXSDK_DIR_VAR) {
error("Missing DXSDK_DIR environment variable. Are you missing the DirectX SDK (June 2010)?")
}
isEmpty(LIB_VAR) {
error("The LIB environment variable is not set. Are you not in a build environment?")
}
isEmpty(INCLUDE_VAR) {
error("The INCLUDE environment variable is not set. Are you not in a build environment?")
}

CONFIG(intelcpp) {
DEFINES *= USE_INTEL_IPP
DEFINES *= RESTRICT=restrict
@@ -47,7 +83,10 @@ win32 {
} else {
QMAKE_CFLAGS_RELEASE *= -Ox -Ot /fp:fast /Qfast_transcendentals -Ob2
QMAKE_CXXFLAGS_RELEASE *= -Ox -Ot /fp:fast /Qfast_transcendentals -Ob2
QMAKE_LFLAGS_RELEASE *= /SafeSEH /NXCOMPAT /DYNAMICBASE
QMAKE_LFLAGS_RELEASE *= /NXCOMPAT /DYNAMICBASE
equals(QMAKE_TARGET.arch, x86) {
QMAKE_LFLAGS_RELEASE -= /SafeSEH
}

# MSVS 2012 and 2013's cl.exe will generate SSE2 code by default,
# unless an explict arch is set.
@@ -107,10 +107,17 @@ FakeInterface::~FakeInterface() {

void FakeInterface::replace(LONG offset, voidMemberFunc replacement) {
void *p = NULL;
#if defined(_M_X86)
_asm {
mov eax, replacement
mov p, eax
}
#elif defined(_M_X64)
// Crash.
ods("Lib: unimplemented FakeInterface::replace on x64. crashing...");
char *c = NULL;
*c = 0;
#endif
ods("Lib: FakeInterface: replace: That gave %p", p);
vtbl[offset] = p;
}
@@ -22,11 +22,10 @@ QMAKE_CXXFLAGS_DEBUG -= -MDd
QMAKE_CXXFLAGS_RELEASE *= -MT
QMAKE_CXXFLAGS_DEBUG *= -MTd

INCLUDEPATH *= "$(DXSDK_DIR)Include"
INCLUDEPATH *= "$$FX11DIR/inc"

LIBS *= -l"$$(DXSDK_DIR)Lib/x86/dxguid" -luuid -lole32 -luser32 -ladvapi32
LIBS *= "$$(DXSDK_DIR)Lib/x86/*"
LIBS *= -ldxguid -luuid -lole32 -luser32 -ladvapi32
LIBS *= -ld3d9 -ld3d10 -ld3d11 -ld3dcompiler -ld3dx9 -ld3dx10 -ld3dx11 -ldxgi

CONFIG(release, debug|release) {
DESTDIR = ../release
@@ -52,6 +52,7 @@ static uint qHash(const GUID &a) {
return val;
}

#ifndef Q_OS_WIN64
static HWND WINAPI HookWindowFromPoint(POINT p);
static BOOL WINAPI HookSetForegroundWindow(HWND hwnd);

@@ -83,6 +84,7 @@ static BOOL WINAPI HookSetForegroundWindow(HWND hwnd) {

return ret;
}
#endif

/**
* Returns a platform specific GlobalShortcutEngine object.
@@ -102,6 +104,10 @@ GlobalShortcutWin::GlobalShortcutWin() {

// Hidden setting to disable hooking
bHook = g.qs->value(QLatin1String("winhooks"), true).toBool();
#ifdef Q_OS_WIN64
qWarning("GlobalShortcutWin: force-disabling 'winhooks' on x64");
bHook = false;
#endif

GetKeyboardState(ucKeyState);

@@ -49,6 +49,10 @@ typedef void (__cdecl *PrepProc)();
extern "C" __declspec(dllexport) void mumbleSelfDetection() {};

OverlayPrivateWin::OverlayPrivateWin(QObject *p) : OverlayPrivate(p) {
#ifdef Q_OS_WIN64
qWarning("Overlay: suppressing OverlayPrivateWin initialization on x64");
return;
#endif

hpInstall = NULL;
hpRemove = NULL;
@@ -185,7 +185,7 @@ win32 {
}
HEADERS *= GlobalShortcut_win.h TaskList.h
SOURCES *= GlobalShortcut_win.cpp TextToSpeech_win.cpp Overlay_win.cpp SharedMemory_win.cpp Log_win.cpp os_win.cpp TaskList.cpp ../../overlay/HardHook.cpp ../../overlay/ods.cpp
LIBS *= -l"$$(DXSDK_DIR)Lib/x86/dxguid" -l"$$(DXSDK_DIR)Lib/x86/dinput8" -lsapi -lole32 -lws2_32 -ladvapi32 -lwintrust -ldbghelp -llibsndfile-1 -lshell32 -lshlwapi -luser32 -lgdi32
LIBS *= -ldxguid -ldinput8 -lsapi -lole32 -lws2_32 -ladvapi32 -lwintrust -ldbghelp -llibsndfile-1 -lshell32 -lshlwapi -luser32 -lgdi32
LIBS *= -ldelayimp -delayload:speex.dll -delayload:shell32.dll

DEFINES *= WIN32
@@ -106,7 +106,13 @@ ice {
QMAKE_LIBDIR *= "$$ICE_PATH/lib/vc100"
} else {
DEFINES *= ICE_STATIC_LIBS
QMAKE_LIBDIR *= $$ICE_PATH/lib $$BZIP2_PATH/lib
QMAKE_LIBDIR *= $$BZIP2_PATH/lib
equals(QMAKE_TARGET.arch, x86) {
QMAKE_LIBDIR *= $$ICE_PATH/lib
}
equals(QMAKE_TARGET.arch, x86_64) {
QMAKE_LIBDIR *= $$ICE_PATH/lib/x64
}
LIBS *= -llibbz2 -ldbghelp -liphlpapi -lrpcrt4
}
}

0 comments on commit c31269a

Please sign in to comment.
You can’t perform that action at this time.