-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mumble, murmur: final adjustments for the win32-static buildenv.
With this change, CONFIG(static) on Windows will cause the Mumble client's application logic to be built into a .DLL called mumble_app.dll (based on pcgod's previous DLL changeset). Since src/mumble will now be built as a DLL, a wrapper executable is available in src/mumble_exe. This wrapper is currently implemented such that it will load mumble_app.dll from the directory that it resides in. This means that when building statically, src/mumble and src/mumble_exe will now give us the following products: src/mumble: mumble_app.dll src/mumble_exe: mumble.exe Along with the two major points above, this change also adds a Python script to the build, 'gen-mumble_app-qt-def.py', whose job is to construct a module definition (.def) file for mumble_app.dll. The generated module definition lists the Qt symbols that are needed for the manual positioning plugin to work. If we need to expose more symbols in the future (say we want to implement more plugin kinds than the current positional audio plugins), we now have the infrastructure in place to do that.
- Loading branch information
Showing
13 changed files
with
510 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
LIBS -= -lQtCore -lQtGui | ||
LIBS -= -lQtCored -lQtGuid | ||
LIBS -= -lQt5Core -lQt5Gui -lQt5Widgets | ||
LIBS -= -lQt5Cored -lQt5Guid -lQt5Widgetsd | ||
|
||
macx { | ||
LIBS += -undefined dynamic_lookup | ||
LIBS -= -lQtCore -lQtGui | ||
LIBS -= -lQt5Core -lQt5Gui -lQt5Widgets | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
#!/usr/bin/env python | ||
# | ||
# Copyright (C) 2013 Mikkel Krautz <mikkel@krautz.dk> | ||
# | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions | ||
# are met: | ||
# | ||
# - Redistributions of source code must retain the above copyright notice, | ||
# this list of conditions and the following disclaimer. | ||
# - Redistributions in binary form must reproduce the above copyright notice, | ||
# this list of conditions and the following disclaimer in the documentation | ||
# and/or other materials provided with the distribution. | ||
# - Neither the name of the Mumble Developers nor the names of its | ||
# contributors may be used to endorse or promote products derived from this | ||
# software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR | ||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
# gen-mumble_app-qt-def.py creates a module definition file (.def) | ||
# for the Qt symbols that mumble_app.dll needs to export to support | ||
# the manual.dll plugin. | ||
# | ||
# The .def file is generated by running dumpbin.exe on a set of static | ||
# Qt libraries, filtering the output to only include the symbols that | ||
# we're interested in. | ||
# | ||
# The filtering process is simply a substring match on the list of | ||
# MSVC mangled names. It might make sense to tune the filter in the | ||
# future, since the current iteration is likely to produce unneeded | ||
# exports. | ||
|
||
import subprocess | ||
import sys | ||
import re | ||
import os | ||
|
||
# qtSymbols list the Qt symbols that we're interested in exporting. | ||
qtSymbols = [ | ||
# QtCore | ||
'QObject', | ||
'QCoreApplication', | ||
'QString', | ||
'QBasicAtomicInt', | ||
|
||
# QtGui/QtWidgets | ||
'QGroupBox', | ||
'QGridLayout', | ||
'QGraphicsScene', | ||
'QWidget', | ||
'QDialog', | ||
'QDialogButton', | ||
'QLabel', | ||
'QLineEdit', | ||
'QAbstractSlider', | ||
'QBrush', | ||
'QGraphicsView', | ||
'QPushButton', | ||
'QDial', | ||
'QSpinBox', | ||
'QValidator', | ||
'QSpacerItem', | ||
'QLayoutItem', | ||
'QAbstractScrollArea', | ||
'QVBoxLayout', | ||
'QLayout', | ||
'QAbstractSpinBox', | ||
'QFrame', | ||
'QBoxLayout', | ||
'QDoubleSpinBox', | ||
'QObject', | ||
'QMetaObject', | ||
'QAbstractButton', | ||
'QPen', | ||
'QHBoxLayout', | ||
'QGraphicsItem', | ||
'QColor', | ||
'QGraphicsView', | ||
'QSizePolicy', | ||
'QMouseEvent', | ||
'QRectF', | ||
'QPointF', | ||
] | ||
|
||
def processExports(f, libs, symbols): | ||
''' | ||
processExports writes a module definition file (.def) to the file object | ||
`f' for all symbols found in the static libraries given in `libs' that | ||
match any of the strings found in `symbols'. | ||
''' | ||
p = subprocess.Popen(['dumpbin.exe', '/linkermember'] + libs, stdout=subprocess.PIPE) | ||
stdout, stderr = p.communicate() | ||
if p.returncode != 0: | ||
raise Exception('dumpbin.exe failed: %s', stderr) | ||
|
||
symbol_re = re.compile('^.*\ (.*(%s)+?.*)$' % '|'.join(symbols)) | ||
f.write('EXPORTS\n\n') | ||
|
||
for line in stdout.split('\r\n'): | ||
m = symbol_re.match(line) | ||
if m is not None: | ||
mangled, matchedsym = m.groups() | ||
f.write(mangled + '\r\n') | ||
|
||
def main(): | ||
if len(sys.argv) < 4: | ||
print 'Usage: gen-mumble_app-qt-def.py <release|debug> <qt-lib-path> <outfn>' | ||
sys.exit(1) | ||
|
||
kind = sys.argv[1] | ||
qtLibDir = sys.argv[2] | ||
outFn = sys.argv[3] | ||
|
||
# Find the absolute path of the Qt libs we're interested in. | ||
# | ||
# If we're in debug mode, look for libraries with a 'd' suffix, | ||
# such as 'QtGuid', rather than 'QtGui'. | ||
# | ||
# Non-existant libs are skipped. This is to allow the script to | ||
# work on both Qt 4 and 5. | ||
suffix = '' | ||
if kind == 'debug': | ||
suffix = 'd' | ||
libs = ['QtCore', 'QtGui', 'QtWidgets'] | ||
libs = ['%s%s.lib' % (lib, suffix) for lib in libs] | ||
abslibs = [os.path.join(qtLibDir, lib) for lib in libs] | ||
abslibs = [lib for lib in abslibs if os.path.exists(lib)] | ||
|
||
with open(outFn, 'w') as f: | ||
processExports(f, abslibs, qtSymbols) | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include <winver.h> | ||
|
||
IDI_ICON1 ICON DISCARDABLE "..\\..\\icons\\mumble.ico" | ||
|
||
#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,2,5,0 | ||
PRODUCTVERSION 1,2,5,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.2.5" | ||
VALUE "ProductVersion", "1.2.5" | ||
VALUE "LegalCopyright", "Copyright (C) 2005-2011, Thorvald Natvig <thorvald@natvig.com>" | ||
VALUE "OriginalFilename", "mumble_app.dll" | ||
VALUE "ProductName", "Mumble" | ||
#ifdef SNAPSHOT_BUILD | ||
VALUE "SpecialBuild", "Snapshot development release" | ||
#endif | ||
END | ||
END | ||
BLOCK "VarFileInfo" | ||
BEGIN | ||
VALUE "Translation", 0x409, 1252 | ||
END | ||
END |
Oops, something went wrong.