Skip to content

Commit

Permalink
Add bazel build system support
Browse files Browse the repository at this point in the history
  • Loading branch information
dpkoch committed Jan 11, 2022
1 parent b084d43 commit 2941e1b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.user
.vscode/

bazel-*
build/
dist/
*.egg-info/
Expand Down
9 changes: 9 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
name = "tidal",
hdrs = ["include/tidal/tidal.h"],
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = ["@eigen3"],
)
18 changes: 18 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

EIGEN_TAG = "3.4.0"
EIGEN_SHA = "1ccaabbfe870f60af3d6a519c53e09f3dcf630207321dffa553564a8e75c4fc8"
http_archive(
name = "eigen3",
build_file_content = """
cc_library(
name = 'eigen3',
includes = ['.'],
hdrs = glob(['Eigen/**']),
visibility = ['//visibility:public'],
)
""",
sha256 = EIGEN_SHA,
strip_prefix = "eigen-{}".format(EIGEN_TAG),
urls = ["https://gitlab.com/libeigen/eigen/-/archive/{0}/eigen-{0}.zip".format(EIGEN_TAG)],
)
7 changes: 7 additions & 0 deletions examples/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
load("@rules_cc//cc:defs.bzl", "cc_binary")

cc_binary(
name = "example",
srcs = ["example.cpp"],
deps = ["//:tidal"],
)

0 comments on commit 2941e1b

Please sign in to comment.