aboutsummaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-07-20 22:33:38 +0200
committer GitHub <noreply@github.com>2023-07-20 22:33:38 +0200
commit420c2dce47e74c01ff46be991058d543e0c70a6b (patch)
tree2fced5640d983144fab9fa982f598203d84887b6 /SConstruct
parent9efd6de04c528587ffe1a05c7ecc9770c4d93f62 (diff)
parent741cfe452156f7c6365d1a66b6228e15ef660bf6 (diff)
Merge pull request #7 from OpenVicProject/dataloading-skeleton
Dataloading Skeleton
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct45
1 files changed, 45 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
new file mode 100644
index 0000000..50edb8f
--- /dev/null
+++ b/SConstruct
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+import os
+import sys
+from glob import glob
+from pathlib import Path
+
+def GlobRecursive(pattern, nodes=['.']):
+ import SCons
+ results = []
+ for node in nodes:
+ nnodes = []
+ for f in Glob(str(node) + '/*', source=True):
+ if type(f) is SCons.Node.FS.Dir:
+ nnodes.append(f)
+ results += GlobRecursive(pattern, nnodes)
+ results += Glob(str(node) + '/' + pattern, source=True)
+ return results
+
+# For future reference:
+# - CCFLAGS are compilation flags shared between C and C++
+# - CFLAGS are for C-specific compilation flags
+# - CXXFLAGS are for C++-specific compilation flags
+# - CPPFLAGS are for pre-processor flags
+# - CPPDEFINES are for pre-processor defines
+# - LINKFLAGS are for linking flags
+env = Environment(
+ CPPDEFINES=["OPENVIC_HEADLESS_SIM"]
+)
+
+# Require C++20
+if sys.platform == "win32" or sys.platform == "msys":
+ env.Append(CXXFLAGS=["/std:c++20", "/EHsc"])
+else:
+ env.Append(CXXFLAGS=["-std=c++20"])
+
+# Tweak this if you want to use different folders, or more folders, to store your source code in.
+paths = ["src"]
+env.Append(CPPPATH=paths)
+sources = GlobRecursive("*.cpp", paths)
+
+program = env.Program("headless-sim", sources)
+
+
+Default(program)
+