summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-10-10 17:42:09 (GMT)
committerTobias Markmann <tm@ayena.de>2016-10-11 14:17:31 (GMT)
commitfc9df1253fa6d3a8f86c06d9e9a0d531ba0f5b13 (patch)
tree8187b58f63aad6621addfd12d4fd77a860dedc68 /Swift/QtUI
parent72343b4eb5b322e3d52e0db95f35423a3b7d6540 (diff)
downloadswift-fc9df1253fa6d3a8f86c06d9e9a0d531ba0f5b13.zip
swift-fc9df1253fa6d3a8f86c06d9e9a0d531ba0f5b13.tar.bz2
Fix building Swift on 32-bit Linux distributions
Some distributions ship Qt configured so it requires your application to be build with the -fPIC flag. This adds a SCons check for this so the flag is automatically added if required. Test-Information: Successfully build Swift and ran unit tests on Ubuntu 16.04 (32 bit and 64 bit) and Debian 8.6 (32 bit and 64 bit). Change-Id: I8016bcb43fa36a3becf946ec179d74cdceb1d147
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/SConscript8
1 files changed, 8 insertions, 0 deletions
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript
index 1ecdf4e..c8313c2 100644
--- a/Swift/QtUI/SConscript
+++ b/Swift/QtUI/SConscript
@@ -74,6 +74,14 @@ myenv.EnableQt4Modules(qt4modules, debug = False, version = qt_version)
myenv.Append(CPPPATH = ["."])
+# Qt requires applications to be build with the -fPIC flag on some 32-bit Linux distributions.
+if env["PLATFORM"] == "posix" :
+ testEnv = myenv.Clone()
+ conf = Configure(testEnv)
+ if conf.CheckDeclaration("QT_REDUCE_RELOCATIONS", "#include <QtCore/qconfig.h>") and conf.CheckDeclaration("__i386__"):
+ myenv.AppendUnique(CXXFLAGS = "-fPIC")
+ testEnv = conf.Finish()
+
if env["PLATFORM"] == "win32" :
#myenv.Append(LINKFLAGS = ["/SUBSYSTEM:CONSOLE"])
myenv.Append(LINKFLAGS = ["/SUBSYSTEM:WINDOWS"])