diff --git a/.gitignore b/.gitignore index ccf302c..5331778 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ -.vscode -build -tmp +/.vscode/ +/bazel-* +/build/ +/tmp/ # Prerequisites *.d diff --git a/BUILD b/BUILD new file mode 100644 index 0000000..cf975dd --- /dev/null +++ b/BUILD @@ -0,0 +1,7 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + +cc_library( + name = "tinytest", + srcs = ["test.cpp"], + hdrs = ["test.h"], +) diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 0000000..a171e31 --- /dev/null +++ b/WORKSPACE @@ -0,0 +1,22 @@ +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +# Hedron's Compile Commands Extractor for Bazel +# https://github.com/hedronvision/bazel-compile-commands-extractor +# To update config run `bazel run @hedron_compile_commands//:refresh_all` +http_archive( + name = "hedron_compile_commands", + sha256 = "99bc3106eb6ce5ffab3c31de8501d4d628de5f1acd74b8b563a876bd39a2e32f", + # Replace the commit hash in both places (below) with the latest, rather than using the stale one here. + strip_prefix = "bazel-compile-commands-extractor-b33a4b05c2287372c8e932c55ff4d3a37e6761ed", + url = "https://github.com/hedronvision/bazel-compile-commands-extractor/archive/b33a4b05c2287372c8e932c55ff4d3a37e6761ed.tar.gz", +) + +load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup") + +hedron_compile_commands_setup() + +http_archive( + name = "com_google_googletest", + strip_prefix = "googletest-ccdeec888ebb740a7ea4e07d3e84a1b7ee32b315", + urls = ["https://github.com/google/googletest/archive/ccdeec888ebb740a7ea4e07d3e84a1b7ee32b315.zip"], +)