File tree 6 files changed +19
-28
lines changed
6 files changed +19
-28
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,6 @@ option(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS
123
123
to provide compile-time errors when using features unavailable on some version of
124
124
the shared library they shipped should turn this on and see `include/__availability`
125
125
for more details." OFF )
126
- option (LIBCXX_ENABLE_CLANG_TIDY "Whether to compile and run clang-tidy checks" OFF )
127
126
128
127
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
129
128
set (LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-gcc.cfg.in" )
@@ -863,10 +862,6 @@ add_subdirectory(modules)
863
862
864
863
set (LIBCXX_TEST_DEPS "cxx_experimental" )
865
864
866
- if (LIBCXX_ENABLE_CLANG_TIDY)
867
- list (APPEND LIBCXX_TEST_DEPS cxx-tidy)
868
- endif ()
869
-
870
865
list (APPEND LIBCXX_TEST_DEPS generate-cxx-modules)
871
866
872
867
if (LIBCXX_INCLUDE_BENCHMARKS)
Original file line number Diff line number Diff line change @@ -82,7 +82,6 @@ Deprecations and Removals
82
82
libatomic is not available. If you are one such user, please reach out to the libc++ developers so we can collaborate
83
83
on a path for supporting atomics properly on freestanding platforms.
84
84
85
-
86
85
Upcoming Deprecations and Removals
87
86
----------------------------------
88
87
@@ -107,3 +106,6 @@ Build System Changes
107
106
108
107
- The ``LIBCXX_EXECUTOR `` and ``LIBCXXABI_EXECUTOR `` CMake variables have been removed. Please
109
108
set ``LIBCXX_TEST_PARAMS `` to ``executor=<...> `` instead.
109
+
110
+ - The Cmake variable ``LIBCXX_ENABLE_CLANG_TIDY `` has been removed. The build system has been changed
111
+ to automatically detect the presence of ``clang-tidy `` and the required ``Clang `` libraries.
Original file line number Diff line number Diff line change 1
1
2
2
set (LIBCXX_TEST_TOOLS_PATH ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
3
3
4
- # TODO: Remove LIBCXX_ENABLE_CLANG_TIDY
5
- if (LIBCXX_ENABLE_CLANG_TIDY)
6
- if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
7
- message (STATUS "Clang-tidy can only be used when building libc++ with "
8
- "a clang compiler." )
9
- return ()
10
- endif ()
11
- add_subdirectory (clang_tidy_checks)
4
+ if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
5
+ message (STATUS "Clang-tidy tests are disabled due to non-clang based compiler." )
6
+ return ()
12
7
endif ()
8
+ add_subdirectory (clang_tidy_checks)
Original file line number Diff line number Diff line change @@ -9,6 +9,17 @@ set(Clang_DIR_SAVE ${Clang_DIR})
9
9
# versions must match. Otherwise there likely will be ODR-violations. This had
10
10
# led to crashes and incorrect output of the clang-tidy based checks.
11
11
find_package (Clang ${CMAKE_CXX_COMPILER_VERSION} )
12
+ if (NOT Clang_FOUND)
13
+ message (STATUS "Clang-tidy tests are disabled since the "
14
+ "Clang development package is unavailable." )
15
+ return ()
16
+ endif ()
17
+ if (NOT TARGET clangTidy)
18
+ message (STATUS "Clang-tidy tests are disabled since the "
19
+ "Clang development package has no clangTidy target." )
20
+ return ()
21
+ endif ()
22
+ message (STATUS "Clang-tidy tests are enabled." )
12
23
13
24
set (SOURCES
14
25
abi_tag_on_virtual.cpp
@@ -22,11 +33,7 @@ set(SOURCES
22
33
libcpp_module.cpp
23
34
)
24
35
25
- if (NOT Clang_FOUND)
26
- message (STATUS "Could not find a suitable version of the Clang development package;
27
- custom libc++ clang-tidy checks will not be available." )
28
- return ()
29
- endif ()
36
+ list (APPEND LIBCXX_TEST_DEPS cxx-tidy)
30
37
31
38
set (LLVM_DIR "${LLVM_DIR_SAVE} " CACHE PATH "The directory containing a CMake configuration file for LLVM." FORCE)
32
39
set (Clang_DIR "${Clang_DIR_SAVE} " CACHE PATH "The directory containing a CMake configuration file for Clang." FORCE)
Original file line number Diff line number Diff line change @@ -43,7 +43,6 @@ definitions:
43
43
44
44
environment_definitions :
45
45
_common_env : &common_env
46
- ENABLE_CLANG_TIDY : " On"
47
46
LLVM_SYMBOLIZER_PATH : " /usr/bin/llvm-symbolizer-${LLVM_HEAD_VERSION}"
48
47
CLANG_CRASH_DIAGNOSTICS_DIR : " crash_diagnostics"
49
48
CC : clang-${LLVM_HEAD_VERSION}
Original file line number Diff line number Diff line change @@ -44,9 +44,6 @@ CMAKE The CMake binary to use. This variable is optional.
44
44
CLANG_FORMAT The clang-format binary to use when generating the format
45
45
ignore list.
46
46
47
- ENABLE_CLANG_TIDY Whether to compile and run clang-tidy checks. This variable
48
- is optional.
49
-
50
47
EOF
51
48
}
52
49
@@ -111,10 +108,6 @@ function clean() {
111
108
rm -rf " ${BUILD_DIR} "
112
109
}
113
110
114
- if [ -z " ${ENABLE_CLANG_TIDY} " ]; then
115
- ENABLE_CLANG_TIDY=Off
116
- fi
117
-
118
111
function generate-cmake-base() {
119
112
echo " --- Generating CMake"
120
113
${CMAKE} \
@@ -126,7 +119,6 @@ function generate-cmake-base() {
126
119
-DLIBCXX_ENABLE_WERROR=YES \
127
120
-DLIBCXXABI_ENABLE_WERROR=YES \
128
121
-DLIBUNWIND_ENABLE_WERROR=YES \
129
- -DLIBCXX_ENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY} \
130
122
-DLLVM_LIT_ARGS=" -sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests" \
131
123
" ${@ } "
132
124
}
You can’t perform that action at this time.
0 commit comments