summaryrefslogtreecommitdiffstats
path: root/config/sanitizer
diff options
context:
space:
mode:
Diffstat (limited to 'config/sanitizer')
-rw-r--r--config/sanitizer/formatting.cmake52
-rw-r--r--config/sanitizer/tools.cmake2
2 files changed, 1 insertions, 53 deletions
diff --git a/config/sanitizer/formatting.cmake b/config/sanitizer/formatting.cmake
index 677a69a..5aaa2a6 100644
--- a/config/sanitizer/formatting.cmake
+++ b/config/sanitizer/formatting.cmake
@@ -90,55 +90,3 @@ function(clang_format TARGET_NAME)
endif()
endfunction()
-#
-# cmake-format
-#
-find_program(CMAKE_FORMAT_EXE "cmake-format")
-mark_as_advanced(FORCE CMAKE_FORMAT_EXE)
-if(CMAKE_FORMAT_EXE)
- message(STATUS "cmake-format found: ${CMAKE_FORMAT_EXE}")
-else()
- message(STATUS "cmake-format not found!")
-endif()
-
-# When called, this function will call 'cmake-format' program on all listed
-# files (if both the program and the files exist and are found)
-# ~~~
-# Required:
-# TARGET_NAME - The name of the target to create.
-#
-# Optional:
-# ARGN - Any arguments passed in will be considered as 'files' to perform the
-# formatting on. Any items that are not files will be ignored. Both relative and
-# absolute paths are accepted.
-# ~~~
-function(cmake_format TARGET_NAME)
- if(CMAKE_FORMAT_EXE)
- set(FORMAT_FILES)
- # Determine files that exist
- foreach(iter IN LISTS ARGN)
- if(EXISTS ${iter})
- set(FORMAT_FILES ${FORMAT_FILES} ${iter})
- elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${iter})
- set(FORMAT_FILES ${FORMAT_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/${iter})
- endif()
- endforeach()
-
- # Generate target
- if(FORMAT_FILES)
- if(TARGET ${TARGET_NAME})
- message(
- ERROR
- "Cannot create cmake-format target '${TARGET_NAME}', already exists.")
- else()
- add_custom_target(${TARGET_NAME} COMMAND ${CMAKE_FORMAT_EXE} -i
- ${FORMAT_FILES})
-
- if(NOT TARGET cmake-format)
- add_custom_target(cmake-format)
- endif()
- add_dependencies(cmake-format ${TARGET_NAME})
- endif()
- endif()
- endif()
-endfunction()
diff --git a/config/sanitizer/tools.cmake b/config/sanitizer/tools.cmake
index 2f73cce..242e33f 100644
--- a/config/sanitizer/tools.cmake
+++ b/config/sanitizer/tools.cmake
@@ -111,4 +111,4 @@ else()
set(CMAKE_CXX_CPPCHECK
""
CACHE STRING "" FORCE) # delete it
-endif() \ No newline at end of file
+endif()