aboutsummaryrefslogtreecommitdiff
path: root/deps
diff options
context:
space:
mode:
author Spartan322 <Megacake1234@gmail.com>2023-11-28 11:09:26 +0100
committer Spartan322 <Megacake1234@gmail.com>2024-05-09 22:11:26 +0200
commit757114a3c5b748567b42f273c7b78ca039ae983c (patch)
treee07390b682052129c91f4b157068bcdd84ceecb4 /deps
parent7211a228e68c8a6b1ad1c1c5ec68c8d720b6d2ba (diff)
Add `deps/dryad` -> https://github.com/Spartan322/dryadadd/dryad
Add `deps/fmt` -> https://github.com/fmtlib/fmt Add `deps/range-v3` -> https://github.com/ericniebler/range-v3 Improve parser error and warning support Update .clang-format Update `deps/SCsub`
Diffstat (limited to 'deps')
-rw-r--r--deps/SCsub78
m---------deps/dryad0
m---------deps/fmt0
m---------deps/range-v30
4 files changed, 76 insertions, 2 deletions
diff --git a/deps/SCsub b/deps/SCsub
index eb27dab..1f04205 100644
--- a/deps/SCsub
+++ b/deps/SCsub
@@ -17,7 +17,7 @@ def build_lexy(env):
lexy_env.Append(CXXFLAGS=["-std=c++20"])
lexy_env.Append(CXXFLAGS=["-pedantic-errors", "-Werror", "-Wall", "-Wextra", "-Wconversion", "-Wsign-conversion"])
- if lexy_env.get("use_llvm"):
+ if lexy_env["CXX"] == "clang++":
lexy_env.Append(CXXFLAGS=["-Wno-shift-op-parentheses", "-Wno-parentheses-equality"])
else:
lexy_env.Append(CXXFLAGS=[
@@ -41,5 +41,79 @@ def build_lexy(env):
env.Append(LIBPATH=[lexy_env.Dir("lexy/src")])
env.Prepend(LIBS=[library_name])
+def build_dryad(env):
+ paths = ["dryad/include"]
+ sources = env.GlobRecursive("*.cpp", paths)
+ env.dryad_sources = sources
+
+ env.Append(CPPPATH=[env.Dir("dryad/include")])
+ if env.get("is_msvc", False):
+ env.Append(CXXFLAGS=["/external:I", env.Dir("dryad/include"), "/external:W0"])
+ else:
+ env.Append(CXXFLAGS=["-isystem", env.Dir("dryad/include")])
+
+def build_fmt(env):
+ fmt_env = env.Clone()
+
+ # Require C++20
+ if fmt_env.get("is_msvc", False):
+ fmt_env.Append(CXXFLAGS=["/std:c++20"])
+
+ fmt_env.Append(CXXFLAGS=["/WX", "/W3", "/D", "_CRT_SECURE_NO_WARNINGS"])
+ else:
+ fmt_env.Append(CXXFLAGS=["-std=c++20"])
+
+ fmt_env.Append(CXXFLAGS=[
+ "-Werror", "-Wall", "-Wextra", "-pedantic", "-Wconversion", "-Wundef"
+ ])
+ if fmt_env["CXX"] == "clang++":
+ fmt_env.Append(CXXFLAGS=[
+ "-Wweak-vtables", "-Wshadow",
+ "-Wno-gnu-zero-variadic-macro-arguments"
+ ])
+ else:
+ fmt_env.Append(CXXFLAGS=[
+ "-Wsign-conversion", "-Wold-style-cast",
+ "-Wundef", "-Wredundant-decls", "-Wwrite-strings",
+ "-Wpointer-arith", "-Wcast-qual", "-Wformat=2",
+ "-Wmissing-include-dirs", "-Wcast-align", "-Wctor-dtor-privacy",
+ "-Wdisabled-optimization", "-Winvalid-pch", "-Woverloaded-virtual",
+ "-Wconversion", "-Wundef", "-Wno-ctor-dtor-privacy", "-Wno-format-nonliteral",
+ "-Wno-dangling-else", "-Wno-unused-local-typedefs", "-Wdouble-promotion",
+ "-Wtrampolines", "-Wzero-as-null-pointer-constant", "-Wuseless-cast",
+ "-Wvector-operation-performance", "-Wsized-deallocation", "-Wshadow",
+ "-Wshift-overflow=2", "-Wnull-dereference", "-Wduplicated-cond"
+ ])
+
+ paths = ["fmt/include", "fmt/src"]
+ fmt_env.Append(CPPPATH=[[fmt_env.Dir(p) for p in paths]])
+ sources = env.GlobRecursive("*.cc", paths, "fmt.cc")
+ env.lexy_sources = sources
+ library_name = "libfmt" + env["LIBSUFFIX"]
+ library = fmt_env.StaticLibrary(target="fmt/src/" + library_name, source=sources)
+ Default(library)
+
+ env.Append(CPPPATH=[fmt_env.Dir("fmt/include")])
+ if env.get("is_msvc", False):
+ env.Append(CXXFLAGS=["/external:I", fmt_env.Dir("fmt/include"), "/external:W0"])
+ else:
+ env.Append(CXXFLAGS=["-isystem", fmt_env.Dir("fmt/include")])
+ env.Append(CXXFLAGS=[""])
+ env.Append(LIBPATH=[fmt_env.Dir("fmt/src")])
+ env.Prepend(LIBS=[library_name])
+
+def build_range_v3(env):
+ paths = ["range-v3/include"]
+ sources = env.GlobRecursive("*.cpp", paths)
+ env.range_v3_sources = sources
+
+ env.Append(CPPPATH=[env.Dir("range-v3/include")])
+ if env.get("is_msvc", False):
+ env.Append(CXXFLAGS=["/external:I", env.Dir("range-v3/include"), "/external:W0"])
+ else:
+ env.Append(CXXFLAGS=["-isystem", env.Dir("range-v3/include")])
-build_lexy(env) \ No newline at end of file
+build_dryad(env)
+build_fmt(env)
+build_lexy(env)
+build_range_v3(env) \ No newline at end of file
diff --git a/deps/dryad b/deps/dryad
new file mode 160000
+Subproject 3aa3d7606cb007436bb3433ddf83b8bdcf1ecc4
diff --git a/deps/fmt b/deps/fmt
new file mode 160000
+Subproject f5e54359df4c26b6230fc61d38aa29458139308
diff --git a/deps/range-v3 b/deps/range-v3
new file mode 160000
+Subproject 97452bb3eb74a73fc86504421a6a27c92bce6b9