Skip to content

Commit

Permalink
Build systems are real systems.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlion committed Oct 23, 2024
1 parent 4cfdf40 commit 8f95202
Show file tree
Hide file tree
Showing 4 changed files with 184 additions and 94 deletions.
3 changes: 1 addition & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
cmake_minimum_required(VERSION 3.30)
include(FetchContent)
cmake_minimum_required(VERSION 3.22.1)

# Turn on verbose output
set(CMAKE_VERBOSE_MAKEFILE ON)
Expand Down
11 changes: 8 additions & 3 deletions cpp/src/lint/msgpack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@
// The list of includes was generated by building with the '-H' compiler flag to print out all
// headers used. The compiler output was filtered for msgpack headers and fed through awk to remove
// duplicates while keeping the order of appearance.
// printf "#include <%s>\n" \
// $(rg --replace '$1' ".*/_deps/msgpack-src/include/(.*\.hpp)$" compiler.log \
// | awk '!a[$0]++')
// 1. Add `-H` in cpp/CMakeLists.txt
// 2. `task build-cpp 2>&1 | tee compiler.log`
// 3. Run to parse the compiler output and create the list of headers:
// ```
// printf "#include <%s>\n"
// $(rg --replace '$1' ".*/build/deps/msgpack-install/include/(.*\.hpp)$" compiler.log
// | awk '!a[$0]++')
// ```

// IWYU pragma: begin_exports
#include <msgpack.hpp>
Expand Down
37 changes: 37 additions & 0 deletions task-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: "3"

vars:
G_LINT_VENV_DIR: "{{.G_BUILD_DIR}}/lint-venv"

tasks:
lint:
deps:
- "lint-cpp"
- "lint-go"
- "lint-yml"

lint-cpp:
deps: ["lint-venv-cpp"]
# cmds:
# - clang-tidy

lint-go:
# deps: ["venv"]
cmds:
# curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh |
# sh -s -- -b $(go env GOPATH)/bin v1.59.0
- |-
golangci-lint run
lint-yml:
# deps: ["venv"]
cmds:
- |-
# . "{{.G_LINT_VENV_DIR}}/bin/activate"
yamllint --strict \
.github \
.golangci.yml \
.yamllint.yml \
cpp/.clang-format \
cpp/.clang-tidy \
taskfile.yml
Loading

0 comments on commit 8f95202

Please sign in to comment.