-
Notifications
You must be signed in to change notification settings - Fork 0
/
SConstruct++
28 lines (24 loc) · 1.06 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
env = Environment()
env.Append(CPPPATH = ["src"])
env.Append(CPPPATH = ["/usr/include"])
Export("env")
test_env = Environment()
test_env["have_boost_test"] = False
Export("test_env")
env.ParseConfig("python3-config --embed --ldflags --includes")
try:
env.ParseConfig("pkg-config --libs --cflags pybind11")
except RuntimeError:
pass
env.AppendUnique(LIBS = ["boost_filesystem", "boost_system", "boost_thread", "boost_program_options", "sqlite3"])
env.AppendUnique(CCFLAGS = Split("-Wall -O2 -march=native -Wno-deprecated -Wno-parentheses -pthread -fvisibility=hidden"), LINKFLAGS = ["-pthread"], CPPDEFINES = ["BOOST_FILESYSTEM_VERSION=3"])
env.Append(CXXFLAGS = ["-std=c++17"])
#env.Append(CCFLAGS = ["-pg"], LINKFLAGS = ["-pg"])
SConscript("src/SConscript")
config_hpp = '''
#ifndef SRC_CONFIG_HPP
#define SRC_CONFIG_HPP
#define PYTHON_MODULES_PATH "''' + env.Dir("python_modules").abspath + '''"
#endif
'''
env.Command(env.File("src/config.hpp"), env.Value(config_hpp), lambda target, source, env: open(target[0].path, "w").write(source[0].get_contents().decode('utf-8')))