Skip to content

Commit

Permalink
Back to Meson
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmdln committed Oct 22, 2023
1 parent e338d67 commit eff19f0
Show file tree
Hide file tree
Showing 15 changed files with 240 additions and 259 deletions.
2 changes: 1 addition & 1 deletion .clangd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (c) 2023 Johnathan C Maudlin <[email protected]>
---
CompileFlags:
CompilationDatabase: build
CompilationDatabase: builddir

Diagnostics:
UnusedIncludes: Strict
7 changes: 3 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ tab_width = 2
indent_size = 2
tab_width = 2

[Makefile]
indent_size = 4
indent_style = "tab"
tab_width = 4
[meson.build]
indent_size = 2
tab_width = 2
38 changes: 14 additions & 24 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ on:
- .clang-tidy
- .clangd
- .github/workflows/lint.yml
- .prettierrc.yml
- include/**/*.h
- meson.build
- include/**/*.h
- src/**/*.c
- src/**/meson.build
push:
Expand All @@ -22,9 +21,8 @@ on:
- .clang-tidy
- .clangd
- .github/workflows/lint.yml
- .prettierrc.yml
- include/**/*.h
- meson.build
- include/**/*.h
- src/**/*.c
- src/**/meson.build
workflow_dispatch:
Expand All @@ -34,41 +32,33 @@ jobs:
strategy:
fail-fast: false
matrix:
linter:
- clang-format
- clang-tidy
linter: [clang-format, clang-tidy]
os:
- name: ubuntu-latest
deps: clang{,-{format,tidy}} cmake git libasan5 libubsan1 lld ninja-build
deps: >
clang{,-{format,tidy}} git lld meson ninja-build
libgc-dev libreadline-dev libasan5 libubsan1
name: ${{ matrix.linter }} (${{ matrix.os.name }})
runs-on: ${{ matrix.os.name }}

steps:
- uses: actions/checkout@v4
with: { submodules: true }

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-{recommends,suggests} ${{ matrix.os.deps }}
- name: Setup build cache
uses: actions/cache@v3
id: build
with:
key: ${{ hashFiles('**/CMakeLists.txt', 'src/*.c', 'include/**/*.h') }}
path: build/

- name: Build Ploy (Debug)
env: { CC: clang, CXX: clang++, LD: lld }
- name: Build Ploy
env: { CC: clang, CC_LD: lld, NINJA: ninja }
run: |
[ ! -e build ] && mkdir build
cmake -G Ninja -B build/ -S ./ \
-DCMAKE_BUILD_TYPE:STRING="RelWithDebInfo"
ninja -C build/
meson setup builddir -Db_sanitize=address,undefined -Dbuildtype=debugoptimized
ninja -C builddir
- name: Test Ploy
run: ninja -C builddir test

# TODO(jcmdln): Only in actions, clang-tidy warns about suppressed warnings
- name: Run ${{ matrix.linter }}
run: |
ninja -C build ${{ matrix.linter }}
run: ninja -C builddir ${{ matrix.linter }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
!.gitignore
!.prettierrc.yml
!LICENSE
!CMakeLists.txt
!meson.build
!Makefile
!README.md

Expand Down
39 changes: 0 additions & 39 deletions .vscode/cmake-kits.json

This file was deleted.

3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"llvm-vs-code-extensions.vscode-clangd",
"redhat.vscode-yaml",
"vadimcn.vscode-lldb",
"ms-vscode.cmake-tools"
"ms-vscode.cmake-tools",
"mesonbuild.mesonbuild"
]
}
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "lldb",
"request": "launch",
"name": "Debug Ploy",
"program": "${workspaceFolder}/build/ploy",
"program": "${workspaceFolder}/builddir/ploy",
"args": [],
"cwd": "${workspaceFolder}"
}
Expand Down
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
"**/builddir/**": true
},

// mesonbuild: Don't pester about or download a random binary
"mesonbuild.downloadLanguageServer": false,
"mesonbuild.languageServer": null,

"mesonbuild.formatting.enabled": false,
"mesonbuild.linter.muon.enabled": true,
"mesonbuild.muonPath": "muon",

// Associate YAML schemas with targets
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": [
Expand All @@ -45,5 +53,8 @@
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[meson]": {
"editor.defaultFormatter": "mesonbuild.mesonbuild"
}
}
98 changes: 0 additions & 98 deletions CMakeLists.txt

This file was deleted.

47 changes: 0 additions & 47 deletions Makefile

This file was deleted.

Loading

0 comments on commit eff19f0

Please sign in to comment.