summaryrefslogtreecommitdiff
path: root/c++/SConscript
diff options
context:
space:
mode:
authorClaudius Holeksa <mail@keldu.de>2023-06-19 20:29:35 +0200
committerClaudius Holeksa <mail@keldu.de>2023-06-19 20:31:06 +0200
commit955905b06c5a45adac73631056c9caa758e6d249 (patch)
tree30944e1cd879873a4780ade60337d749b79fa620 /c++/SConscript
parentcaa36e5cb2be6c0f37ff8cc0c500cc41beec1d42 (diff)
c++,nix: basic setup
Diffstat (limited to 'c++/SConscript')
-rw-r--r--c++/SConscript37
1 files changed, 37 insertions, 0 deletions
diff --git a/c++/SConscript b/c++/SConscript
new file mode 100644
index 0000000..d696204
--- /dev/null
+++ b/c++/SConscript
@@ -0,0 +1,37 @@
+#!/bin/false
+
+import os
+import os.path
+import glob
+
+
+Import('env')
+
+dir_path = Dir('.').abspath
+
+# Environment for base library
+core_env = env.Clone();
+
+core_env.sources = sorted(glob.glob(dir_path + "/*.cpp"));
+core_env.headers = sorted(glob.glob(dir_path + "/*.h"));
+
+env.sources += core_env.sources;
+env.headers += core_env.headers;
+
+
+## Shared lib
+objects = []
+core_env.add_source_files(objects, core_env.sources, shared=False);
+
+# Cavity2D
+core_env.cavity_2d_source = sorted(glob.glob(dir_path + "/examples/cavity_2d.cpp"));
+env.sources += core_env.cavity_2d_source;
+core_env.cavity_2d = core_env.Program('#bin/cavity_2d', [core_env.cavity_2d_source, core_env.objects]);
+
+# Set Alias
+env.Alias('examples', [core_env.cavity_2d]);
+
+env.targets += ['examples'];
+
+# Install
+env.Install('$prefix/bin', ['examples']);