mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-25 01:14:19 +00:00
cmake+ci: run clang-tidy
This commit is contained in:
16
.github/workflows/build.yml
vendored
16
.github/workflows/build.yml
vendored
@@ -14,18 +14,20 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
toolchain:
|
toolchain:
|
||||||
- { name: 'MSVC', shell: 'sh', setup-cmake: true, setup-ninja: true, setup-msvc: true }
|
- { name: 'MSVC', shell: 'sh', setup-cmake: true, setup-ninja: true, setup-msvc: true }
|
||||||
- { name: 'msys2 mingw32', shell: 'msys2 {0}', setup-msys2: true }
|
- { name: 'msys2 mingw32', shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686, clang-tidy: true }
|
||||||
|
- { name: 'msys2 clang32', shell: 'msys2 {0}', msystem: clang32, msys-env: mingw-w64-clang-i686, clang-tidy: true }
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set up MSYS2
|
- name: Set up MSYS2
|
||||||
if: matrix.toolchain.setup-msys2
|
if: ${{ !!matrix.toolchain.msystem }}
|
||||||
uses: msys2/setup-msys2@v2
|
uses: msys2/setup-msys2@v2
|
||||||
with:
|
with:
|
||||||
msystem: mingw32
|
msystem: ${{ matrix.toolchain.msystem }}
|
||||||
install: >-
|
install: >-
|
||||||
mingw-w64-i686-cc
|
${{ matrix.toolchain.msys-env }}-cc
|
||||||
mingw-w64-i686-cmake
|
${{ matrix.toolchain.msys-env }}-cmake
|
||||||
mingw-w64-i686-ninja
|
${{ matrix.toolchain.msys-env }}-ninja
|
||||||
|
${{ matrix.toolchain.msys-env }}-clang-tools-extra
|
||||||
|
|
||||||
- name: Setup cmake
|
- name: Setup cmake
|
||||||
if: matrix.toolchain.setup-cmake
|
if: matrix.toolchain.setup-cmake
|
||||||
@@ -45,7 +47,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -GNinja -Werror=dev
|
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -GNinja -Werror=dev -DENABLE_CLANG_TIDY=${{ !!matrix.toolchain.clang-tidy }}
|
||||||
cmake --build build
|
cmake --build build
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
|||||||
@@ -2,6 +2,14 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
|
|||||||
|
|
||||||
project(isle CXX)
|
project(isle CXX)
|
||||||
|
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
|
||||||
|
option(ENABLE_CLANG_TIDY "Enable clang-tidy")
|
||||||
|
if (ENABLE_CLANG_TIDY)
|
||||||
|
find_program(CLANG_TIDY_BIN NAMES "clang-tidy")
|
||||||
|
set(CMAKE_C_CLANG_TIDY "${CLANG_TIDY_BIN}")
|
||||||
|
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_BIN}")
|
||||||
|
endif()
|
||||||
|
|
||||||
math(EXPR bits "8 * ${CMAKE_SIZEOF_VOID_P}")
|
math(EXPR bits "8 * ${CMAKE_SIZEOF_VOID_P}")
|
||||||
message(STATUS "Building ${bits}-bit LEGO Island")
|
message(STATUS "Building ${bits}-bit LEGO Island")
|
||||||
if (NOT bits EQUAL 32)
|
if (NOT bits EQUAL 32)
|
||||||
|
|||||||
Reference in New Issue
Block a user