summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Tanner <thosrtanner2@users.sourceforge.net>2015-03-22 10:51:43 +0000
committerTom Tanner <thosrtanner2@users.sourceforge.net>2015-03-22 10:51:43 +0000
commit266a6964290033ee86923e96524df8d077d6578a (patch)
tree5acdefbe0d72cee45b05c2ec8988ef49d3dff3b5 /src
parent07b8896f92568083870a5ad61f83e3cb2e4e97ff (diff)
parentea520baf4e4a512744552a8528e3b41145796151 (diff)
Merge
Diffstat (limited to 'src')
-rw-r--r--src/ModOrganizer.pro5
-rw-r--r--src/SConscript122
-rw-r--r--src/organizer.pro3
-rw-r--r--src/plugincontainer.cpp4
-rw-r--r--src/savegamegamebyro.h3
-rw-r--r--src/savetextasdialog.cpp4
-rw-r--r--src/shared/SConscript25
-rw-r--r--src/shared/shared.pro3
8 files changed, 163 insertions, 6 deletions
diff --git a/src/ModOrganizer.pro b/src/ModOrganizer.pro
index c0e5d9f5..0ff8b6c5 100644
--- a/src/ModOrganizer.pro
+++ b/src/ModOrganizer.pro
@@ -49,3 +49,8 @@ for(QTNAME, QTLIBNAMES) {
}
INSTALLS += qtlibs otherlibs
+
+OTHER_FILES +=\
+ ../SConstruct\
+ ../scons_configure.py\
+ SConscript
diff --git a/src/SConscript b/src/SConscript
new file mode 100644
index 00000000..1d69c1d6
--- /dev/null
+++ b/src/SConscript
@@ -0,0 +1,122 @@
+import os
+import subprocess
+
+Import('qt_env')
+
+env = qt_env.Clone()
+
+modules = [
+ 'Core',
+ 'Gui',
+ 'Network',
+ 'Script',
+ 'Sql',
+ 'WebKit',
+ 'Xml',
+ 'XmlPatterns',
+ 'Declarative'
+]
+
+if env['QT_MAJOR_VERSION'] > 4:
+ modules += [
+ 'Widgets',
+ 'Qml',
+ 'WebKitWidgets'
+ ]
+
+env.EnableQtModules(*modules)
+
+env.Uic4(env.Glob('*.ui'))
+
+env.RequireLibraries('uibase', 'shared', 'bsatk', 'esptk')
+
+
+env.AppendUnique(LIBS = [
+ 'shell32',
+ 'user32',
+ 'ole32',
+ 'advapi32',
+ 'gdi32',
+ 'shlwapi',
+ 'Psapi',
+ 'Version'
+])
+
+# We have to 'persuade' moc to generate certain other targets and inject them
+# into the list of cpps
+other_sources = env.AddExtraMoc(env.Glob('*.h'))
+
+for file in env.Glob('*.rc'):
+ if file.name == 'version.rc':
+ continue
+ other_sources.append(env.RES(file))
+
+# Note the order of this is important, or you can pick up the wrong report.h...
+# Doing appendunique seems to throw the moc code into a tizzy
+env['CPPPATH'] += [
+ '../archive',
+# '../boss_modified/boss-api',
+ '../plugins/gamefeatures',
+ '.', # Why is this necessary?
+ '${LOOTPATH}',
+ '${BOOSTPATH}',
+]
+
+env.AppendUnique(CPPDEFINES = [
+ '_UNICODE',
+ '_CRT_SECURE_NO_WARNINGS',
+ '_SCL_SECURE_NO_WARNINGS',
+ 'BOOST_DISABLE_ASSERTS',
+ 'NDEBUG',
+ 'QT_MESSAGELOGCONTEXT'
+])
+
+env.AppendUnique(CPPFLAGS = [ '-wd4100', '-wd4127', '-wd4512', '-wd4189' ])
+
+env.AppendUnique(LINKFLAGS = [
+ '/SUBSYSTEM:WINDOWS',
+ '${EXE_MANIFEST_DEPENDENCY}'
+])
+
+# modeltest is optional and it doesn't compile anyway...
+cpp_files = [
+ x for x in Glob('*.cpp')
+ if x.name != 'modeltest.cpp' and x.name != 'aboutdialog.cpp'
+]
+
+about_env = env.Clone()
+hgid = subprocess.check_output(['hg', 'id', '-i']).rstrip()
+# FIXME: It'd be much easier to stringify this in the source code
+about_env.AppendUnique(CPPDEFINES = [ 'HGID=\\"%s\\"' % hgid ])
+other_sources.append(about_env.StaticObject('aboutdialog.cpp'))
+
+env.AppendUnique(LIBPATH = "${ZLIBPATH}/build")
+env.AppendUnique(LIBS = 'zlibstatic')
+
+prog = env.Program('ModOrganizer',
+ cpp_files + env.Glob('*.qrc') + other_sources)
+
+env.InstallModule(prog)
+
+for subdir in ('tutorials', 'stylesheets'):
+ env.Install(os.path.join(env['INSTALL_PATH'], subdir),
+ env.Glob(os.path.join(subdir, '*')))
+
+# FIXME Sort the translations. Except they don't exist on the 1.2 branch
+
+res = env['QT_USED_MODULES']
+Return('res')
+
+"""
+CONFIG(debug, debug|release) {
+} else {
+ QMAKE_CXXFLAGS += /Zi /GL
+ QMAKE_LFLAGS += /DEBUG /LTCG /OPT:REF /OPT:ICF
+}
+
+TRANSLATIONS = organizer_en.ts
+
+
+QMAKE_POST_LINK += xcopy /y /s /I $$quote($$BASEDIR\\*.qm) $$quote($$DSTDIR)\\translations $$escape_expand(\\n)
+
+"""
diff --git a/src/organizer.pro b/src/organizer.pro
index 9300f348..e7177af3 100644
--- a/src/organizer.pro
+++ b/src/organizer.pro
@@ -360,6 +360,9 @@ CONFIG(debug, debug|release) {
}
}
+OTHER_FILES += \
+ SConscript
+
DISTFILES += \
tutorials/tutorial_primer_main.js \
tutorials/Tooltip.qml \
diff --git a/src/plugincontainer.cpp b/src/plugincontainer.cpp
index 6bc9d12b..e1d9d9f0 100644
--- a/src/plugincontainer.cpp
+++ b/src/plugincontainer.cpp
@@ -266,7 +266,7 @@ void PluginContainer::loadPlugins()
loadCheck.flush();
QString pluginName = iter.filePath();
if (QLibrary::isLibrary(pluginName)) {
- QPluginLoader *pluginLoader = new QPluginLoader(pluginName, this);
+ std::unique_ptr<QPluginLoader> pluginLoader(new QPluginLoader(pluginName, this));
if (pluginLoader->instance() == nullptr) {
m_FailedPlugins.push_back(pluginName);
qCritical("failed to load plugin %s: %s",
@@ -274,7 +274,7 @@ void PluginContainer::loadPlugins()
} else {
if (registerPlugin(pluginLoader->instance(), pluginName)) {
qDebug("loaded plugin \"%s\"", qPrintable(pluginName));
- m_PluginLoaders.push_back(pluginLoader);
+ m_PluginLoaders.push_back(pluginLoader.release());
} else {
m_FailedPlugins.push_back(pluginName);
qWarning("plugin \"%s\" failed to load", qPrintable(pluginName));
diff --git a/src/savegamegamebyro.h b/src/savegamegamebyro.h
index eedda6c2..e08e1044 100644
--- a/src/savegamegamebyro.h
+++ b/src/savegamegamebyro.h
@@ -22,10 +22,9 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "savegame.h"
-#include <gameinfo.h>
+
#include <QString>
#include <QObject>
-#include <QImage>
#include <QMetaType>
#include <QFile>
diff --git a/src/savetextasdialog.cpp b/src/savetextasdialog.cpp
index 1f23356f..1a940094 100644
--- a/src/savetextasdialog.cpp
+++ b/src/savetextasdialog.cpp
@@ -1,6 +1,6 @@
#include "savetextasdialog.h"
#include "ui_savetextasdialog.h"
-#include <report.h>
+#include "report.h"
#include <QClipboard>
#include <QFileDialog>
@@ -37,7 +37,7 @@ void SaveTextAsDialog::on_saveAsBtn_clicked()
if (!fileName.isEmpty()) {
QFile file(fileName);
if (!file.open(QIODevice::WriteOnly)) {
- MOBase::reportError(tr("failed to open \"%1\" for writing").arg(fileName));
+ reportError(tr("failed to open \"%1\" for writing").arg(fileName));
return;
}
diff --git a/src/shared/SConscript b/src/shared/SConscript
new file mode 100644
index 00000000..69a95289
--- /dev/null
+++ b/src/shared/SConscript
@@ -0,0 +1,25 @@
+Import('qt_env')
+
+env = qt_env.Clone()
+
+env.EnableQtModules('Core', 'Gui')
+
+env.AppendUnique(CPPDEFINES = [
+ 'UNICODE',
+ '_UNICODE',
+ '_CRT_SECURE_NO_WARNINGS',
+ 'BOOST_DISABLE_ASSERTS',
+ 'NDEBUG'
+])
+
+env.AppendUnique(CPPPATH = [
+ '../bsatk',
+ '${BOOSTPATH}',
+ '.' # Seriously!
+])
+
+# Not sure if renaming this helps much as it's static
+env.StaticLibrary('mo_shared', env.Glob('*.cpp'))
+
+res = env['QT_USED_MODULES']
+Return('res')
diff --git a/src/shared/shared.pro b/src/shared/shared.pro
index 1e26b7c0..646c2c3e 100644
--- a/src/shared/shared.pro
+++ b/src/shared/shared.pro
@@ -73,3 +73,6 @@ DEFINES += BOOST_DISABLE_ASSERTS NDEBUG
# QMAKE_CXXFLAGS += /analyze
INCLUDEPATH += ../bsatk "$${BOOSTPATH}"
+
+OTHER_FILES += \
+ SConscript