summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/BuildingGenerics.txt4
-rw-r--r--Documentation/BuildingOnUnix.txt5
-rw-r--r--Documentation/SwiftenDevelopersGuide/Examples/EchoBot/.gitignore1
-rw-r--r--Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp2
-rw-r--r--Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp9
-rw-r--r--Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript7
-rw-r--r--Documentation/SwiftenDevelopersGuide/Swiften Developers Guide.xml15
7 files changed, 35 insertions, 8 deletions
diff --git a/Documentation/BuildingGenerics.txt b/Documentation/BuildingGenerics.txt
index 27ac55e..66f3347 100644
--- a/Documentation/BuildingGenerics.txt
+++ b/Documentation/BuildingGenerics.txt
@@ -1,2 +1,6 @@
To cause scons to search for dependencies instead of using cached results, add force-configure=1 to the commandline:
scons force-configure=1
+
+Swift is usually built with Qt4. If you want to build it against Qt5, add the line
+qt5 = 1
+to your config.py
diff --git a/Documentation/BuildingOnUnix.txt b/Documentation/BuildingOnUnix.txt
index 46e1939..ef74387 100644
--- a/Documentation/BuildingOnUnix.txt
+++ b/Documentation/BuildingOnUnix.txt
@@ -2,8 +2,8 @@ Prerequisites
------------
- GCC
- Python
-- OpenSSL
-- Qt Open Source Edition (optional; not needed for Swiften)
+- OpenSSL (and development package)
+- Qt Open Source Edition (and development package. Optional; not needed for Swiften)
Building
--------
@@ -18,6 +18,7 @@ Building
Running tests
-------------
+If you want to run the unit tests (only interesting if you're doing development work)
- Run
./scons test=unit
for running the unit tests.
diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/.gitignore b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/.gitignore
index 91c939b..aca6fe1 100644
--- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/.gitignore
+++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/.gitignore
@@ -2,3 +2,4 @@ EchoBot?
*.cpp.xml
*.h.xml
EchoComponent
+Swiften.cpp
diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp
index deeb852..8b81489 100644
--- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp
+++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp
@@ -12,7 +12,7 @@
using namespace Swift;
using namespace boost;
-Client* client;
+static Client* client;
void handleConnected();
void handleMessageReceived(Message::ref message);
diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp
index 397bc21..a6e6ca0 100644
--- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp
+++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Remko Tronçon
+ * Copyright (c) 2010-2013 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
@@ -14,9 +14,8 @@ using namespace boost;
class EchoComponent {
public:
- EchoComponent(EventLoop* eventLoop, NetworkFactories* networkFactories) : jid("echo.wonderland.lit") {
- component = new Component(eventLoop, networkFactories,
- jid, "EchoSecret");
+ EchoComponent(NetworkFactories* networkFactories) : jid("echo.wonderland.lit") {
+ component = new Component(jid, "EchoSecret", networkFactories);
component->onConnected.connect(bind(&EchoComponent::handleConnected, this));
component->onMessageReceived.connect(
bind(&EchoComponent::handleMessageReceived, this, _1));
@@ -62,7 +61,7 @@ int main(int, char**) {
SimpleEventLoop eventLoop;
BoostNetworkFactories networkFactories(&eventLoop);
- EchoComponent bot(&eventLoop, &networkFactories);
+ EchoComponent bot(&networkFactories);
eventLoop.run();
return 0;
diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript
index b267e80..aa9f691 100644
--- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript
+++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript
@@ -4,6 +4,13 @@ example_env = env.Clone()
example_env.UseFlags(example_env["SWIFTEN_FLAGS"])
example_env.UseFlags(example_env["SWIFTEN_DEP_FLAGS"])
+# Precompile Swiften header
+# This is useful to slightly speed up compilation.
+if example_env["PLATFORM"] == "win32":
+ example_env.WriteVal("Swiften.cpp", example_env.Value("#include <Swiften/Swiften.h>\n"))
+ example_env["PCH"] = example_env.PCH("Swiften.cpp")[0]
+ example_env["PCHSTOP"] = "Swiften/Swiften.h"
+
for i in range(1,7) :
example_env.Program("EchoBot" + str(i), ["EchoBot" + str(i) + ".cpp"])
example_env.Program("EchoComponent", "EchoComponent.cpp")
diff --git a/Documentation/SwiftenDevelopersGuide/Swiften Developers Guide.xml b/Documentation/SwiftenDevelopersGuide/Swiften Developers Guide.xml
index fae79e4..345d049 100644
--- a/Documentation/SwiftenDevelopersGuide/Swiften Developers Guide.xml
+++ b/Documentation/SwiftenDevelopersGuide/Swiften Developers Guide.xml
@@ -117,6 +117,21 @@
whereas calling it with the <literal>--cflags</literal> option will return the
list of C(++) compiler flags.
</para>
+
+ <para>
+ An example of setting up a build of a Swiften application using SCons is shown
+ in <xref linkend="Example-SCons"/>.
+ </para>
+
+ <example id="Example-SCons">
+ <title><literal>SConstruct</literal> file to build Swiften application with SCons</title>
+ <programlisting>
+env = Environment()
+env["SWIFTEN_CONFIG"] = "/path/to/swiften-config"
+env.MergeFlags(env.subst("!$SWIFTEN_CONFIG --cflags --libs"))
+env.Program("EchoBot.cpp")
+ </programlisting>
+ </example>
</sect1>
<sect1>