diff --git a/.gitignore b/.gitignore index be09b56..2732855 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ examples/smallc examples/foobar examples/tree_traversal build/* +bazel-* +MODULE.bazel.lock \ No newline at end of file diff --git a/BUILD.bazel b/BUILD.bazel new file mode 100644 index 0000000..8468b46 --- /dev/null +++ b/BUILD.bazel @@ -0,0 +1,50 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + +cc_library( + name = "mpc", + srcs = [ + "mpc.c", + ], + hdrs = [ + "mpc.h", + ], + copts = [ + "-ansi", + "-pedantic", + "-O3", + "-g", + "-Wall", + "-Werror", + "-Wextra", + "-Wformat=2", + "-Wshadow", + "-Wno-long-long", + "-Wno-overlength-strings", + "-Wno-format-nonliteral", + "-Wcast-align", + "-Wwrite-strings", + "-Wstrict-prototypes", + "-Wold-style-definition", + "-Wredundant-decls", + "-Wnested-externs", + "-Wmissing-include-dirs", + "-Wswitch-default", + ], + visibility = ["//visibility:public"], +) + +cc_test( + name = "mpc_test", + srcs = [ + "tests/combinators.c", + "tests/core.c", + "tests/grammar.c", + "tests/ptest.c", + "tests/ptest.h", + "tests/regex.c", + "tests/test.c", + ], + deps = [ + ":mpc", + ] +) \ No newline at end of file diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 0000000..1e84f0c --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,6 @@ +module( + name = "mpc", + version = "0.9.8", +) + +bazel_dep(name = "rules_cc", version = "0.1.2") \ No newline at end of file