summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct33
1 files changed, 33 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
new file mode 100644
index 0000000..2952dbc
--- /dev/null
+++ b/SConstruct
@@ -0,0 +1,33 @@
+import os
+
+env = Environment(
+ ENV = os.environ,
+)
+
+AddOption('--release', action = 'store_true')
+AddOption('--profiling', action = 'store_true')
+AddOption('--mingw32', action = 'store_true')
+
+env.Append(CPPPATH = ['.', 'common'])
+
+# cross-compiling
+if GetOption('mingw32'):
+ env.Append(LIBS = ['winmm', 'wsock32', 'ws2_32', 'mingw32', 'noise', 'boost_filesystem-mt-s', 'boost_system-mt-s', 'boost_thread_win32-mt-s'])
+ env.Append(LINKFLAGS = ['-static-libgcc', '-static-libstdc++'])
+ env.Append(CPPFLAGS = ['-D_WIN32_WINDOWS', '-DBOOST_THREAD_USE_LIB'])
+ env['CXX'] = 'i486-mingw32-g++'
+else:
+ env.Append(LIBS = ['noise', 'boost_filesystem', 'boost_thread'])
+
+if not GetOption('release'):
+ env.Append(CPPFLAGS = ['-Wall', '-g'])
+
+if GetOption('profiling'):
+ env.Append(CPPFLAGS = ['-pg'])
+ env.Append(LINKFLAGS = ['-pg'])
+
+Export('env')
+
+env.Program('gressd.exe' if GetOption('mingw32') else 'gressd', Glob('*.cpp') + Glob('common/*.cpp') + ['noiseutils/noiseutils.cpp'])
+
+# vim: syn=python