diff third_party/luajit/BUILD @ 186:8cf4ec5e2191 hg-web

Fixed merge conflict.
author MrJuneJune <me@mrjunejune.com>
date Fri, 23 Jan 2026 22:38:59 -0800
parents 94705b5986b3
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/third_party/luajit/BUILD	Fri Jan 23 22:38:59 2026 -0800
@@ -0,0 +1,40 @@
+load("@rules_foreign_cc//foreign_cc:defs.bzl", "make")
+
+package(default_visibility = ["//visibility:public"])
+
+filegroup(
+    name = "srcs",
+    srcs = glob(["**"]),
+)
+
+make(
+    name = "luajit_build",
+    args = ["-j4"],
+    build_data = [":srcs"],
+    env = {
+        "BUILDMODE": "static",
+    },
+    lib_source = ":srcs",
+    out_binaries = ["luajit"],
+    out_data_dirs = ["share"],
+    out_include_dir = "include/luajit-2.1",
+    out_static_libs = ["libluajit-5.1.a"],
+    postfix_script = "cd $$INSTALLDIR$$/bin && find . -name 'luajit-*' -type f -exec cp {} luajit \\;",
+    targets = [
+        "",
+        "install PREFIX=$$INSTALLDIR$$",
+    ],
+)
+
+# Alias for the library
+alias(
+    name = "luajit",
+    actual = ":luajit_build",
+)
+
+# Expose just the binary for use as a tool
+filegroup(
+    name = "luajit_bin",
+    srcs = [":luajit_build"],
+    output_group = "luajit",
+)