Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utilize FixFormat.cmake #112

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
Loading