]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/ecm/do-not-override-custom-clang-format-files.patch
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / ports / ecm / do-not-override-custom-clang-format-files.patch
1 From 0d5ed9bb9117f6526691b3572bf85090efbeed4a Mon Sep 17 00:00:00 2001
2 From: Alexander Lohnau <alexander.lohnau@gmx.de>
3 Date: Sat, 30 Jan 2021 13:44:07 +0100
4 Subject: [PATCH] KDEClangFormat: Do not override custom clang-format files
5
6 ---
7 kde-modules/KDEClangFormat.cmake | 13 ++++++++++++-
8 1 file changed, 12 insertions(+), 1 deletion(-)
9
10 diff --git a/kde-modules/KDEClangFormat.cmake b/kde-modules/KDEClangFormat.cmake
11 index 6cdbd2b5..995f03ad 100644
12 --- a/kde-modules/KDEClangFormat.cmake
13 +++ b/kde-modules/KDEClangFormat.cmake
14 @@ -35,7 +35,18 @@ find_program(KDE_CLANG_FORMAT_EXECUTABLE clang-format)
15
16 # instantiate our clang-format file, must be in source directory for tooling if we have the tool
17 if(KDE_CLANG_FORMAT_EXECUTABLE)
18 - configure_file(${CMAKE_CURRENT_LIST_DIR}/clang-format.cmake ${CMAKE_CURRENT_SOURCE_DIR}/.clang-format @ONLY)
19 + set(CLANG_FORMAT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/.clang-format)
20 + if (EXISTS ${CLANG_FORMAT_FILE})
21 + file(READ ${CLANG_FORMAT_FILE} CLANG_FORMAT_CONTENTS LIMIT 128)
22 + string(FIND "${CLANG_FORMAT_CONTENTS}" "SPDX-FileCopyrightText: 2019 Christoph Cullmann" matchres)
23 + if(${matchres} EQUAL -1)
24 + message(WARNING "The .clang-format file already exists. Please remove it in order to use the file provided by ECM")
25 + else()
26 + configure_file(${CMAKE_CURRENT_LIST_DIR}/clang-format.cmake ${CLANG_FORMAT_FILE} @ONLY)
27 + endif()
28 + else()
29 + configure_file(${CMAKE_CURRENT_LIST_DIR}/clang-format.cmake ${CLANG_FORMAT_FILE} @ONLY)
30 + endif()
31 endif()
32
33 # formatting target