Skip to content
Permalink
Browse files

Build two separate Windows overlays - one for x86 and one for x86_64.

This splits fx11 into an x86 variant and an x64 variant.
This creates effects11_x86.lib and effects11_x64.lib, instead
of the single effects11.lib we had previously.

The minhook build is also tweaked. However, since minhook
is only used on x86_64, it is only built for x86_64.
Consequently, the library is still called minhook.lib.

The overlay itself is split into mumble_ol.dll and mumble_ol.exe
for x86, and mumble_ol_x64.dll and mumble_ol_x64.exe for x86_64.
  • Loading branch information...
mkrautz committed Jan 23, 2015
1 parent 4a478f7 commit 3a6c4f0fee7b1d56b9cef25d422833c7c6633dd8
@@ -20,6 +20,7 @@ ui_*.h
*.qm
installer/Mumble.exe
overlay/*.hex
overlay_winx64/*.hex
scripts/Murmur.ice
scripts/murmur.ini.*
src/murmur/Murmur.h
@@ -1,13 +1,22 @@
include(../../compiler.pri)

BUILDDIR=$$basename(PWD)
SOURCEDIR=$$replace(BUILDDIR,-build,-src)
SOURCEDIR=$$replace(BUILDDIR,-build-shared,-src)

!exists(../$$SOURCEDIR/Effect.h) {
message("The $$SOURCEDIR/ directory was not found. Please update your submodules (git submodule update --init).")
error("Aborting configuration")
}

CONFIG(debug, debug|release) {
CONFIG += console
DESTDIR = ../../debug
}

CONFIG(release, debug|release) {
DESTDIR = ../../release
}

TEMPLATE = lib
CONFIG *= debug_and_release warn_on
CONFIG *= staticlib
@@ -0,0 +1,3 @@
CONFIG += force-x86_64-toolchain
include(../fx11-build-shared/fx11-build-shared.pro)
TARGET = effects11_x64
@@ -0,0 +1,3 @@
CONFIG += force-x86-toolchain
include(../fx11-build-shared/fx11-build-shared.pro)
TARGET = effects11_x86
@@ -1,3 +1,4 @@
CONFIG += force-x86_64-toolchain
include(../../compiler.pri)

BUILDDIR=$$basename(PWD)
@@ -29,9 +29,7 @@ CONFIG *= ordered debug_and_release
}

win32 {
equals(QMAKE_TARGET.arch, x86_64) {
SUBDIRS *= 3rdparty/minhook-build
}
SUBDIRS *= 3rdparty/minhook-build
}

SUBDIRS *= src/mumble
@@ -45,9 +43,12 @@ CONFIG *= ordered debug_and_release
}

win32 {
SUBDIRS *= 3rdparty/fx11-build
SUBDIRS *= 3rdparty/fx11-build-x86
SUBDIRS *= 3rdparty/fx11-build-x64
SUBDIRS *= overlay
SUBDIRS *= overlay/overlay_exe
SUBDIRS *= overlay_winx64
SUBDIRS *= overlay_winx64/overlay_exe_winx64
!CONFIG(no-g15) {
SUBDIRS *= g15helper
}
@@ -0,0 +1,71 @@
include (../compiler.pri)

VERSION = 1.3.0
TARGET_EXT = .dll
TEMPLATE = lib
CONFIG -= qt
CONFIG *= dll shared debug_and_release warn_on
CONFIG -= embed_manifest_dll
TARGET = mumble_ol
RC_FILE = mumble_ol.rc
SOURCES = lib.cpp d3d9.cpp dxgi.cpp d3d10.cpp d3d11.cpp ods.cpp opengl.cpp HardHook.cpp D11StateBlock.cpp
HEADERS = lib.h ods.h HardHook.h overlay_blacklist.h D11StateBlock.h ../3rdparty/GL/glext.h
EFFECTS = overlay.fx
DIST = overlay.h overlay.fx HardHook.h
FX11DIR = "../3rdparty/fx11-src"
FX11DIR_BUILD = $$replace(FX11DIR,-src,-build)

DEFINES -= UNICODE

QMAKE_CXXFLAGS_RELEASE -= -MD
QMAKE_CXXFLAGS_DEBUG -= -MDd

QMAKE_CXXFLAGS_RELEASE *= -MT
QMAKE_CXXFLAGS_DEBUG *= -MTd

INCLUDEPATH *= "$$FX11DIR/inc"

LIBS *= -ldxguid -luuid -lole32 -luser32 -ladvapi32
LIBS *= -ld3d9 -ld3d10 -ld3d11 -ld3dcompiler -ld3dx9 -ld3dx10 -ld3dx11 -ldxgi

CONFIG(force-x86_64-toolchain) {
LIBS *= -leffects11_x64

DEFINES += USE_MINHOOK
INCLUDEPATH *= ../3rdparty/minhook-src/include
LIBS *= -lminhook
}

CONFIG(force-x86-toolchain) {
LIBS *= -leffects11_x86
}

CONFIG(release, debug|release) {
DESTDIR = ../release
QMAKE_LIBDIR += ../release
}

CONFIG(debug, debug|release) {
DESTDIR = ../debug
QMAKE_LIBDIR += ../debug
DEFINES *= DEBUG
}

# Override fxc binary for the x86 build.
CONFIG(force-x86-toolchain) {
FXC = "\"$$(DXSDK_DIR)\Utilities\bin\x86\fxc.exe\""
} else {
FXC = fxc.exe
}

fxc.output = ${QMAKE_FILE_BASE}.hex
fxc.commands = $${FXC} /Tfx_4_0 /O3 /Fh${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME}
fxc.input = EFFECTS
fxc.CONFIG *= no_link target_predeps
QMAKE_EXTRA_COMPILERS *= fxc

fxc11.output = ${QMAKE_FILE_BASE}11.hex
fxc11.commands = $${FXC} /Tfx_5_0 /O3 /Fh${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME}
fxc11.input = EFFECTS
fxc11.CONFIG *= no_link target_predeps
QMAKE_EXTRA_COMPILERS *= fxc11
@@ -1,60 +1,2 @@
include (../compiler.pri)

VERSION = 1.3.0
TARGET_EXT = .dll
TEMPLATE = lib
CONFIG -= qt
CONFIG *= dll shared debug_and_release warn_on
CONFIG -= embed_manifest_dll
TARGET = mumble_ol
RC_FILE = mumble_ol.rc
SOURCES = lib.cpp d3d9.cpp dxgi.cpp d3d10.cpp d3d11.cpp ods.cpp opengl.cpp HardHook.cpp D11StateBlock.cpp
HEADERS = lib.h ods.h HardHook.h overlay_blacklist.h D11StateBlock.h ../3rdparty/GL/glext.h
EFFECTS = overlay.fx
DIST = overlay.h overlay.fx HardHook.h
FX11DIR = "../3rdparty/fx11-src"
FX11DIR_BUILD = $$replace(FX11DIR,-src,-build)

DEFINES -= UNICODE

QMAKE_CXXFLAGS_RELEASE -= -MD
QMAKE_CXXFLAGS_DEBUG -= -MDd

QMAKE_CXXFLAGS_RELEASE *= -MT
QMAKE_CXXFLAGS_DEBUG *= -MTd

INCLUDEPATH *= "$$FX11DIR/inc"

LIBS *= -ldxguid -luuid -lole32 -luser32 -ladvapi32
LIBS *= -ld3d9 -ld3d10 -ld3d11 -ld3dcompiler -ld3dx9 -ld3dx10 -ld3dx11 -ldxgi

equals(QMAKE_TARGET.arch, x86_64) {
DEFINES += USE_MINHOOK
INCLUDEPATH *= ../3rdparty/minhook-src/include
LIBS *= -lminhook
}

CONFIG(release, debug|release) {
DESTDIR = ../release
QMAKE_LIBDIR += ../release
LIBS *= -l$$FX11DIR_BUILD/release/effects11
}

CONFIG(debug, debug|release) {
DESTDIR = ../debug
QMAKE_LIBDIR += ../debug
DEFINES *= DEBUG
LIBS *= -l$$FX11DIR_BUILD/debug/effects11
}

fxc.output = ${QMAKE_FILE_BASE}.hex
fxc.commands = fxc /Tfx_4_0 /O3 /Fh${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME}
fxc.input = EFFECTS
fxc.CONFIG *= no_link target_predeps
QMAKE_EXTRA_COMPILERS *= fxc

fxc11.output = ${QMAKE_FILE_BASE}11.hex
fxc11.commands = fxc /Tfx_5_0 /O3 /Fh${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME}
fxc11.input = EFFECTS
fxc11.CONFIG *= no_link target_predeps
QMAKE_EXTRA_COMPILERS *= fxc11
CONFIG += force-x86-toolchain
include(overlay-shared.pro)
@@ -0,0 +1,38 @@
include(../../compiler.pri)

TEMPLATE = app
CONFIG -= qt
CONFIG += debug_and_release
TARGET = mumble_ol

win32 {
DEFINES += WIN32 _WIN32
RC_FILE = overlay_exe.rc
LIBS *= -luser32 -lshlwapi

CONFIG(release, debug|release) {
QMAKE_CXXFLAGS_RELEASE -= -MD
QMAKE_CXXFLAGS += -MT
}
CONFIG(debug, debug|release) {
QMAKE_CXXFLAGS_DEBUG -= -MDd
QMAKE_CXXFLAGS += -MTd
}
}

SOURCES *= overlay_exe.cpp

QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$quote(mt.exe -nologo -updateresource:$(DESTDIR_TARGET);1 -manifest ../../src/mumble/mumble.appcompat.manifest)

CONFIG(debug, debug|release) {
CONFIG += console
DEFINES *= DEBUG
DESTDIR = ../../debug
}

CONFIG(release, debug|release) {
DEFINES *= NDEBUG
DESTDIR = ../../release
}

include(../../symbols.pri)
@@ -91,7 +91,7 @@ static std::wstring GetAbsoluteMumbleOverlayDllPath() {

std::wstring absDLLPath(exePath);
absDLLPath.append(L"\\");
absDLLPath.append(L"mumble_ol.dll");
absDLLPath.append(MUMBLE_OVERLAY_DLL_NAME);
return absDLLPath;
}

@@ -31,6 +31,12 @@
#ifndef MUMBLE_OVERLAY_EXE_H_
#define MUMBLE_OVERLAY_EXE_H_

#if defined(_M_IX86)
const wchar_t *MUMBLE_OVERLAY_DLL_NAME = L"mumble_ol.dll";
#elif defined (_M_X64)
const wchar_t *MUMBLE_OVERLAY_DLL_NAME = L"mumble_ol_x64.dll";
#endif

/// OverlayHelperError represents exit codes returned by the
/// overlay helper process (mumble_ol.exe) on Windows.
enum OverlayHelperError {
@@ -1,38 +1,2 @@
include(../../compiler.pri)

TEMPLATE = app
CONFIG -= qt
CONFIG += debug_and_release
TARGET = mumble_ol

win32 {
DEFINES += WIN32 _WIN32
RC_FILE = overlay_exe.rc
LIBS *= -luser32 -lshlwapi

CONFIG(release, debug|release) {
QMAKE_CXXFLAGS_RELEASE -= -MD
QMAKE_CXXFLAGS += -MT
}
CONFIG(debug, debug|release) {
QMAKE_CXXFLAGS_DEBUG -= -MDd
QMAKE_CXXFLAGS += -MTd
}
}

SOURCES *= overlay_exe.cpp

QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$quote(mt.exe -nologo -updateresource:$(DESTDIR_TARGET);1 -manifest ../../src/mumble/mumble.appcompat.manifest)

CONFIG(debug, debug|release) {
CONFIG += console
DEFINES *= DEBUG
DESTDIR = ../../debug
}

CONFIG(release, debug|release) {
DEFINES *= NDEBUG
DESTDIR = ../../release
}

include(../../symbols.pri)
CONFIG += force-x86-toolchain
include(overlay_exe-shared.pro)
@@ -0,0 +1,44 @@
#include <winver.h>

#ifndef DEBUG
#define VER_DEBUG 0L
#else
#define VER_DEBUG VS_FF_DEBUG
#endif

#ifdef SNAPSHOT_BUILD
#define VER_RELEASE VS_FF_SPECIALBUILD|VS_FF_PRERELEASE
#else
#define VER_RELEASE 0L
#endif

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,0,0
PRODUCTVERSION 1,3,0,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS (VER_DEBUG|VER_RELEASE)
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "Thorvald Natvig"
VALUE "FileDescription", "Mumble - Low-latency VoIP client"
VALUE "FileVersion", "1.3.0"
VALUE "ProductVersion", "1.3.0"
VALUE "LegalCopyright", "Copyright (C) 2005-2011, Thorvald Natvig <thorvald@natvig.com>"
VALUE "OriginalFilename", "mumble_ol_x64.dll"
VALUE "ProductName", "Mumble"
#ifdef SNAPSHOT_BUILD
VALUE "SpecialBuild", "Snapshot development release"
#endif
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
@@ -0,0 +1,44 @@
#include <winver.h>

#ifndef DEBUG
#define VER_DEBUG 0L
#else
#define VER_DEBUG VS_FF_DEBUG
#endif

#ifdef SNAPSHOT_BUILD
#define VER_RELEASE VS_FF_SPECIALBUILD|VS_FF_PRERELEASE
#else
#define VER_RELEASE 0L
#endif

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,0,0
PRODUCTVERSION 1,3,0,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS (VER_DEBUG|VER_RELEASE)
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "Thorvald Natvig"
VALUE "FileDescription", "Mumble - Low-latency VoIP client"
VALUE "FileVersion", "1.3.0"
VALUE "ProductVersion", "1.3.0"
VALUE "LegalCopyright", "Copyright (C) 2005-2011, Thorvald Natvig <thorvald@natvig.com>"
VALUE "OriginalFilename", "mumble_ol_x64.exe"
VALUE "ProductName", "Mumble"
#ifdef SNAPSHOT_BUILD
VALUE "SpecialBuild", "Snapshot development release"
#endif
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END

0 comments on commit 3a6c4f0

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