-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSconstruct
40 lines (31 loc) · 1.14 KB
/
Sconstruct
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# # SConstruct
import os
import shutil
import subprocess
import multiprocessing
from SCons.Script import *
# Set the C++ version to C++20
env = Environment(CXXFLAGS='-std=c++20 -g -Wall ', tools=['default', 'g++'])
program_name = 'redrobot_'
# Define DEBUG or RELEASE based on the target
if ARGUMENTS.get('target') == 'debug':
program_name += 'debug'
env.Append(CPPDEFINES=['DEBUG'])
env.Append(CXXFLAGS='-g -Og') # Add debug information
else:
program_name += 'release'
env.Append(CPPDEFINES=['RELEASE'])
env.Append(CXXFLAGS='-O3') # Add optimization level for release
# Include directories
env.Append(CPPPATH=[Glob('includes/**'),'src/includes','src/references','src/nodes','src/servers'])
# Source files
src_files = Glob('src/**/*.cpp')
references_files = Glob('src/references/*.cpp')
# Libs directory
env.Append(LIBPATH=['libs'])
if ARGUMENTS.get('target') == 'debug':
env.Append(LIBS=['JoltDebug','PlayRhoDebug','raylibDebug','yamlDebug'])
else:
env.Append(LIBS=['JoltRelease','PlayRhoRelease','raylibRelease','yamlRelease'])
# Build the executable
env.Program(target=program_name, source=['src/main.cpp']+ src_files)