Files
product-fpol/tools/build_workspace.py
khodowany 78b2c383f1
ci / frontend (push) Successful in 9m13s
ci / backend (push) Failing after 6m40s
Game Features
2026-10-04 23:20:06 -05:00

30 lines
1.3 KiB
Python

"""Build this checkout against the sibling library checkouts, without publishing."""
import argparse
import pathlib
import subprocess
ROOT = pathlib.Path(__file__).resolve().parents[1]
def run(*args):
subprocess.run(list(map(str, args)), cwd=ROOT, check=True)
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--build-type", choices=("Debug", "Release"), default="Debug")
parser.add_argument("--test", action="store_true")
options = parser.parse_args()
build = ROOT / "build" / ("workspace_" + options.build_type.lower())
for name in ("modulus", "noto", "ligo"):
source = ROOT.parent / name
if not (source / "conanfile.py").exists():
parser.error(f"Missing sibling repository: {source}")
run("conan", "export", source)
run("conan", "install", ROOT, "--output-folder", build / "dependencies", "--build=missing", "-s", "compiler.cppstd=23", "-s", "build_type=" + options.build_type, "-o", "&:with_tests=False")
run("cmake", "-S", ROOT, "-B", build, "-G", "Ninja", "-DCMAKE_TOOLCHAIN_FILE=" + str(build / "dependencies/conan_toolchain.cmake"), "-DCMAKE_BUILD_TYPE=" + options.build_type, "-DBUILD_TESTING=ON")
run("cmake", "--build", build, "--parallel", "2")
if options.test:
run("ctest", "--test-dir", build, "--output-on-failure")
if __name__ == "__main__":
main()