Skip to content

Commit 5641a3d

Browse files
committed
Add bazel support
1 parent 5bf2658 commit 5641a3d

File tree

8 files changed

+219
-0
lines changed

8 files changed

+219
-0
lines changed

.bazelrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Build options
2+
build --enable_platform_specific_config
3+
build --cxxopt=-std=c++17
4+
5+
# Platform-specific settings
6+
build:linux --copt=-static
7+
build:linux --copt=-static-libgcc
8+
build:linux --copt=-static-libstdc++
9+
10+
# Windows specific settings
11+
build:windows --copt=/MT
12+
13+
# Testing options
14+
test --test_output=errors
15+
16+
# Release build settings
17+
build:release -c opt
18+
build:release --strip=always

.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8.0.0

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@
3030
*.exe
3131
*.out
3232
*.app
33+
34+
build
35+
bazel-*

BUILD.bazel

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
cc_binary(
2+
name = "run-cppcheck",
3+
srcs = [
4+
"main.cpp",
5+
"config.cpp",
6+
"config.h",
7+
"picojson.h",
8+
],
9+
copts = [
10+
"-std=c++17",
11+
],
12+
visibility = ["//visibility:public"],
13+
)
14+

MODULE.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module(
2+
name = "run_cppcheck",
3+
version = "0.1.0",
4+
)
5+
6+
bazel_dep(name = "platforms", version = "0.0.8")

MODULE.bazel.lock

Lines changed: 160 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ A wrapper for cppcheck to simplify cppcheck integration. This program exists to
44
to configure how to run cppcheck on a single file, that can be shared between editor plugins.
55
The log file also provides additional information that plugins may be lacking.
66

7+
## Building
8+
9+
### CMake
10+
```console
11+
mkdir build && cd build
12+
cmake ..
13+
make
14+
```
15+
16+
### Bazel
17+
```console
18+
bazel build //:run-cppcheck
19+
```
20+
21+
The compiled binary will be located at `bazel-bin/run-cppcheck`.
22+
723
## Invocation
824

925
```console

WORKSPACE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
workspace(name = "run_cppcheck")

0 commit comments

Comments
 (0)