Skip to content

Commit 584c271

Browse files
committed
1 parent f79afcf commit 584c271

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@
2626
[submodule "tests/benchmarks/deps/nanobench"]
2727
path = tests/benchmarks/deps/nanobench
2828
url = https://github.com/Spartan322/nanobench
29+
[submodule "deps/lauf"]
30+
path = deps/lauf
31+
url = https://github.com/OpenVicProject/lauf

deps/SCsub

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,58 @@ def build_std_function(env):
4545
env.Append(CPPPATH=env.std_function["INCPATH"])
4646
env.exposed_includes += env.std_function["INCPATH"]
4747

48+
def build_lauf(env):
49+
import os
50+
51+
if (env.get("is_msvc", False) and not env.get("use_clang_cl")) or (env["CXX"] != "clang++" and env["optimize"] == "none"):
52+
env.Append(CPPDEFINES=["LAUF_HAS_TAIL_CALL_ELIMINATION=0"])
53+
else:
54+
env.Append(CPPDEFINES=["LAUF_HAS_TAIL_CALL_ELIMINATION=1"])
55+
56+
lauf_env = env.Clone()
57+
58+
if lauf_env.get("is_msvc", False):
59+
lauf_env.Append(CXXFLAGS=["/WX", "/W3", "/D", "_CRT_SECURE_NO_WARNINGS"])
60+
if lauf_env.get("use_clang_cl"):
61+
lauf_env.Append(CXXFLAGS=["-Wno-return-type-c-linkage", "-fomit-frame-pointer"])
62+
lauf_env.Append(CXXFLAGS=["/wd5105"])
63+
else:
64+
lauf_env.Append(CXXFLAGS=["/Oy"])
65+
else:
66+
lauf_env.Append(CXXFLAGS=["-pedantic-errors", "-Werror", "-Wall", "-Wextra", "-Wconversion", "-Wsign-conversion", "-fomit-frame-pointer"])
67+
if lauf_env["CXX"] == "clang++":
68+
lauf_env.Append(CXXFLAGS=["-Wno-return-type-c-linkage"])
69+
lauf_env.Append(CXXFLAGS=["-Wno-shift-op-parentheses", "-Wno-parentheses-equality"])
70+
else:
71+
lauf_env.Append(
72+
CXXFLAGS=[
73+
"-Wno-parentheses",
74+
"-Wno-unused-local-typedefs",
75+
"-Wno-array-bounds", # , "-Wno-maybe-uninitialized", "-Wno-restrict"
76+
]
77+
)
78+
79+
lexy_include_path = "openvic-dataloader/deps/lexy/include"
80+
include_path = "lauf/include"
81+
source_path = "lauf/src"
82+
lauf_env.Append(CPPPATH=[[lauf_env.Dir(p) for p in [lexy_include_path, source_path, include_path]]])
83+
sources = lauf_env.GlobRecursive("*.cpp", [source_path])
84+
env.lauf_sources = sources
85+
86+
library_name = "liblauf" + env["LIBSUFFIX"]
87+
library = lauf_env.StaticLibrary(target=os.path.join(source_path, library_name), source=sources)
88+
Default(library)
89+
90+
include_dir = lauf_env.Dir(include_path)
91+
source_dir = lauf_env.Dir(source_path)
92+
env.Append(CPPPATH=[include_dir])
93+
if env.get("is_msvc", False):
94+
env.Append(CXXFLAGS=["/external:I", include_dir, "/external:W0"])
95+
else:
96+
env.Append(CXXFLAGS=["-isystem", include_dir])
97+
env.Append(LIBPATH=[source_dir])
98+
env.Prepend(LIBS=[library_name])
99+
48100
def link_tbb(env):
49101
import sys
50102
if not env.get("is_msvc", False) and not env.get("use_mingw", False) and sys.platform != "darwin":
@@ -56,4 +108,5 @@ build_ordered_map(env)
56108
build_colony(env)
57109
build_function2(env)
58110
build_std_function(env)
111+
build_lauf(env)
59112
link_tbb(env)

deps/lauf

Submodule lauf added at 9d34f38

0 commit comments

Comments
 (0)