mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 04:41:16 +00:00
Add make format target to run clang-format
This commit is contained in:
@@ -153,7 +153,7 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR
|
||||
set(yaml_cxx_flags "-Wall ${GCC_EXTRA_OPTIONS} -pedantic -Wno-long-long ${yaml_cxx_flags}")
|
||||
|
||||
### Make specific
|
||||
if(${CMAKE_BUILD_TOOL} STREQUAL make OR ${CMAKE_BUILD_TOOL} STREQUAL gmake)
|
||||
if(${CMAKE_BUILD_TOOL} MATCHES make OR ${CMAKE_BUILD_TOOL} MATCHES gmake)
|
||||
add_custom_target(debuggable $(MAKE) clean
|
||||
COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug ${CMAKE_SOURCE_DIR}
|
||||
COMMENT "Adjusting settings for debug compilation"
|
||||
@@ -162,6 +162,10 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR
|
||||
COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release ${CMAKE_SOURCE_DIR}
|
||||
COMMENT "Adjusting settings for release compilation"
|
||||
VERBATIM)
|
||||
add_custom_target(format
|
||||
COMMAND clang-format --style=file -i ${all_sources}
|
||||
COMMENT "Running clang-format"
|
||||
VERBATIM)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
Reference in New Issue
Block a user