Skip to content

Commit 4b68dbb

Browse files
Merge pull request #3 from andreiavrammsd/bazel
Bazel
2 parents 3d7aea4 + 2e4887f commit 4b68dbb

File tree

15 files changed

+136
-4
lines changed

15 files changed

+136
-4
lines changed

.github/workflows/bazel.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: bazel
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
bazel:
8+
runs-on: ubuntu-22.04
9+
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: bazelbuild/setup-bazelisk@v2
13+
- name: Mount bazel cache
14+
uses: actions/cache@v3
15+
with:
16+
path: "~/.cache/bazel"
17+
key: bazel
18+
19+
- run: bazel test poly_map_test --test_output=all

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.idea
2-
cmake-build-*
2+
*build*
3+
*bazel*

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"files.insertFinalNewline": true,
3+
"files.trimFinalNewlines": true,
4+
}

BUILD

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
cc_library(
2+
name = "poly_map",
3+
hdrs = ["include/msd/poly_map.hpp"],
4+
includes = ["include"],
5+
visibility = ["//visibility:public"],
6+
)
7+
8+
cc_test(
9+
name = "poly_map_test",
10+
size = "small",
11+
srcs = ["tests/poly_map_test.cpp"],
12+
copts = ["--std=c++17 -Wall -Wextra -Wpedantic -Werror"],
13+
deps = [
14+
":poly_map",
15+
"@gtest//:gtest_main",
16+
],
17+
)

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.17)
22
project(poly_map)
3-
set(PROJECT_VERSION 0.2.0)
3+
set(PROJECT_VERSION 0.3.0)
44

55
set(CMAKE_CXX_STANDARD 17)
66
set(CMAKE_CXX_STANDARD_REQUIRED YES)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A recursive map that can have any shape and can hold multiple types for keys and
1515
## Requirements
1616

1717
* C++17
18-
* CMake 3.17+
18+
* CMake 3.17+ or Bazel
1919

2020
## Usage
2121

WORKSPACE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2+
3+
http_archive(
4+
name = "gtest",
5+
url = "https://github.com/google/googletest/archive/release-1.10.0.zip",
6+
sha256 = "94c634d499558a76fa649edb13721dce6e98fb1e7018dfaeba3cd7a083945e91",
7+
build_file = "@//:gtest.BUILD",
8+
strip_prefix = "googletest-release-1.10.0",
9+
)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
BasedOnStyle: Google
2+
IndentWidth: 4
3+
Language: Cpp
4+
PointerAlignment: Right
5+
BreakBeforeBraces: Stroustrup
6+
ColumnLimit: 120

examples/bazel-project/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea
2+
*build*
3+
*bazel*

examples/bazel-project/BUILD

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
cc_binary(
2+
name = "bazel-project",
3+
srcs = ["src/main.cpp"],
4+
deps = [
5+
"@poly_map//:poly_map",
6+
],
7+
copts = ["--std=c++17"],
8+
)

0 commit comments

Comments
 (0)