Skip to content

Commit

Permalink
bazel integration
Browse files Browse the repository at this point in the history
  • Loading branch information
mikea committed Dec 23, 2024
1 parent 925969b commit 28cda74
Show file tree
Hide file tree
Showing 7 changed files with 322 additions and 1 deletion.
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build --cxxopt="-std=c++20"
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ benchmarks/competitors/servo-url/debug
benchmarks/competitors/servo-url/target

#ignore VScode
.vscode/
.vscode/

# bazel output
bazel-*
20 changes: 20 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cc_library(
name = "ada",
srcs = [
"src/ada.cpp",
],
hdrs = glob([
"include/*.h",
"include/ada/*.h",
# todo: this can be included by every client of the library, but there is no better way
# since .cpp files are included into each other.
"src/*.cpp",
]),
# todo: once .cpp files are not included, rather then polluting -I flags, src/ should
# be dropped from hdrs and this replaced by `strip_include_prefix = "include"`
includes = [
"include",
"include/ada",
],
visibility = ["//visibility:public"],
)
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bazel_dep(name = "googletest", version = "1.15.2")
280 changes: 280 additions & 0 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

http_file(
name = "simdjson",
url = "http://example.com/file",
sha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
)
9 changes: 9 additions & 0 deletions tests/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cc_test(
name = "url_search_params",
srcs = ["url_search_params.cpp"],
deps = [
"//:ada",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)

0 comments on commit 28cda74

Please sign in to comment.