Skip to content

Commit

Permalink
build: utilize FixFormat.cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
threeal committed Jun 1, 2024
1 parent e6a52ce commit 33a0f84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ jobs:
- name: Checkout this repository
uses: actions/[email protected]

- name: Configure and check formatting
- name: Configure Project
uses: threeal/[email protected]
with:
run-build: true
build-args: --target format --target check-format
options: BUILD_TESTING=ON

- name: Check Formatting
run: |
cmake --build build --target format-all
git diff --exit-code HEAD
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ target_include_directories(result INTERFACE include)
target_link_libraries(result INTERFACE error)

if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
cpmaddpackage(
GITHUB_REPOSITORY TheLartians/Format.cmake
VERSION 1.8.0
OPTIONS "FORMAT_SKIP_CMAKE ON"
)

if(BUILD_TESTING)
enable_testing()

Expand All @@ -44,4 +38,8 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
target_link_libraries(result_test PRIVATE result Catch2::Catch2WithMain)
catch_discover_tests(result_test)
endif()

cpmaddpackage(gh:threeal/[email protected])
include(${FixFormat_SOURCE_DIR}/cmake/FixFormat.cmake)
add_fix_format()
endif()

0 comments on commit 33a0f84

Please sign in to comment.