Skip to content

Commit

Permalink
Add pre-commit workflow (#318)
Browse files Browse the repository at this point in the history
* Add pre-commit workflow

* Fix pre-commit issues
  • Loading branch information
Twon authored Jul 2, 2024
1 parent e378aa1 commit 27c6b93
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .conan/profiles/arch/armv8
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[settings]
arch=armv8
arch=armv8
14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.0
2 changes: 1 addition & 1 deletion cmake/morpheus_add_library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ function(morpheus_add_library)
EXPORT morpheus-export-set
NAMESPACE morpheus::
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/morpheus"
)
)

endfunction()
12 changes: 6 additions & 6 deletions cmake/morpheus_add_target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function(morpheus_add_target)
add_executable(${MORPHEUS_ALIAS} ALIAS ${MORPHEUS_NAME})
endif()
else()
add_library(${MORPHEUS_NAME} ${isInterface})
add_library(${MORPHEUS_NAME} ${isInterface})
add_library(${MORPHEUS_ALIAS} ALIAS ${MORPHEUS_NAME})
endif()

Expand Down Expand Up @@ -132,15 +132,15 @@ function(morpheus_add_target_properties)
set(oneValueArgs NAME FOLDER)
set(multiValueArgs)
cmake_parse_arguments(MORPHEUS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

if(${MORPHEUS_INTERFACE})
set(scope "INTERFACE")
else()
set(scope "PUBLIC")
set(scope "PUBLIC")
endif()

target_compile_features(${MORPHEUS_NAME} ${scope} cxx_std_23)
target_compile_features(${MORPHEUS_NAME} ${scope} cxx_std_23)

set_target_properties(${MORPHEUS_NAME}
PROPERTIES
CXX_STANDARD 23
Expand All @@ -160,7 +160,7 @@ function(morpheus_add_target_properties)

# Create an empty header set here so that the subsequent install step finds it.
target_sources(${MORPHEUS_NAME} ${scope} FILE_SET HEADERS FILES)

install(TARGETS ${MORPHEUS_NAME}
EXPORT morpheus-export-set
FILE_SET HEADERS
Expand Down
3 changes: 1 addition & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ def package_info(self):
self.cpp_info.components["vulkan"].set_property("cmake_file_name", "MorpheusGfxVulkan")
self.cpp_info.components["vulkan"].set_property("cmake_target_name", "morpheus::gfx::vulkan")
self.cpp_info.components["vulkan"].requires.append("vulkan-headers::vulkan-headers")

if (self.settings.os in ["Macos", "iOS", "tvOS"]):
self.cpp_info.components["vulkan"].requires.append("moltenvk::moltenvk")

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
target_sources(MorpheusGfxNVidia
PUBLIC
FILE_SET HEADERS
FILES
FILES
adapter.hpp
driver.hpp
functions.hpp
Expand Down

0 comments on commit 27c6b93

Please sign in to comment.