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

chore: sync with dev #299

Merged
merged 10 commits into from
May 2, 2024
Prev Previous commit
Next Next commit
build: add clang-format cmake target (#272)
  • Loading branch information
FlayaN authored Apr 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 1edc187da2a57f64afba0070fe8cac1d5ff17dcc
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -120,6 +120,18 @@ target_sources(
${CMAKE_CURRENT_BINARY_DIR}/cmake/FeatureVersions.h
)

# #######################################################################################################################
# # clang-format
# #######################################################################################################################

find_program(CLANG_FORMAT_PATH clang-format)
if(CLANG_FORMAT_PATH)
add_custom_target(FORMAT_CODE
COMMAND ${CLANG_FORMAT_PATH} -i -style=file ${CPP_SOURCES};${HLSL_FILES}
COMMENT "Running clang format for cpp and hlsl files"
)
endif()

# #######################################################################################################################
# # Automatic deployment
# #######################################################################################################################
4 changes: 4 additions & 0 deletions cmake/AddCXXFiles.cmake
Original file line number Diff line number Diff line change
@@ -53,6 +53,10 @@ function(add_cxx_files TARGET)

set(HLSL_FILES ${HLSL_FILES} PARENT_SCOPE)

list(APPEND CPP_SOURCES ${HEADER_FILES})
list(APPEND CPP_SOURCES ${SOURCE_FILES})
set(CPP_SOURCES ${CPP_SOURCES} PARENT_SCOPE)

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/
PREFIX "HLSL Files"
FILES ${HLSL_FILES})
Loading