Skip to content

Commit 5ddf284

Browse files
committed
Update to the Clang v20.1.7 version of the main
Also make sure we build only the plugin, since the upstream clang now supports loading clang-tidy plugins via the -load option.
1 parent 38a6dad commit 5ddf284

21 files changed

+29
-2007
lines changed

CMakeLists.txt

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,34 @@
11
cmake_minimum_required(VERSION 3.4.3)
22
enable_testing()
33

4-
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
5-
# require at least gcc 12.0 !!
6-
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0)
7-
message(FATAL_ERROR "GCC version must be at least 12.0!")
8-
endif()
9-
endif()
10-
11-
12-
if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
13-
project(O2CodeChecker)
14-
15-
16-
# find clang + llvm
17-
find_package(Clang REQUIRED CONFIG)
18-
19-
if( LLVM_FOUND )
20-
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
21-
include(AddLLVM)
4+
project(O2CodeChecker)
225

23-
# set the compiler flags to match llvm
24-
include(HandleLLVMOptions)
25-
endif()
6+
# find clang + llvm
7+
find_package(Clang REQUIRED CONFIG)
268

27-
# Make sure that our source directory is on the current cmake module path so that
28-
# we can include cmake files from this directory.
29-
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
9+
if( LLVM_FOUND )
10+
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
11+
include(AddLLVM)
3012

31-
# include Clang macros (unfortunately they are not part of the cmake installation)
32-
include(AddClang)
13+
# set the compiler flags to match llvm
14+
include(HandleLLVMOptions)
15+
endif()
3316

34-
# add include directories
35-
include_directories(${LLVM_INCLUDE_DIRS})
17+
# Make sure that our source directory is on the current cmake module path so that
18+
# we can include cmake files from this directory.
19+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
3620

37-
set(LLVM_LINK_COMPONENTS
38-
Support
39-
)
21+
# include Clang macros (unfortunately they are not part of the cmake installation)
22+
include(AddClang)
4023

4124
# the main executable
4225
add_subdirectory(tool)
4326

4427
# the specific aliceO2 checker code
4528
add_subdirectory(aliceO2)
46-
# the specific reporting tools code
47-
add_subdirectory(reporting)
48-
49-
# plugin
50-
add_subdirectory(plugin)
5129

5230
# for testing
5331
add_subdirectory(test)
5432

5533
# some extra utilities
5634
add_subdirectory(utility)
57-
58-
string(REPLACE "." ";" LLVM_PACKAGE_VERSION_LIST ${LLVM_PACKAGE_VERSION})
59-
list(GET LLVM_PACKAGE_VERSION_LIST 0 LLVM_PACKAGE_VERSION_MAJOR)
60-
install(FILES omp.h DESTINATION lib/clang/${LLVM_PACKAGE_VERSION_MAJOR}/include)
61-
62-
endif()

FileExtensionsSet.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

GlobList.h

Lines changed: 0 additions & 66 deletions
This file was deleted.

NoLintDirectiveHandler.h

Lines changed: 0 additions & 47 deletions
This file was deleted.

aliceO2/CMakeLists.txt

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
set(LLVM_LINK_COMPONENTS support)
1+
add_library(clangTidyAliceO2Module MODULE "")
2+
target_compile_options(clangTidyAliceO2Module PRIVATE -fno-rtti)
3+
target_include_directories(clangTidyAliceO2Module
4+
PRIVATE
5+
${CLANG_INCLUDE_DIRS}
6+
${LLVM_INCLUDE_DIRS}
7+
)
28

3-
add_clang_library(clangTidyAliceO2Module
4-
AliceO2TidyModule.cpp
5-
MemberNamesCheck.cpp
6-
NamespaceNamingCheck.cpp
7-
SizeofCheck.cpp
8-
9-
LINK_LIBS
10-
clangAST
11-
clangASTMatchers
12-
clangBasic
13-
clangLex
14-
clangTidy
15-
clangTidyUtils
16-
clangTooling
17-
)
9+
target_sources(clangTidyAliceO2Module
10+
PRIVATE
11+
${CMAKE_CURRENT_LIST_DIR}/AliceO2TidyModule.cpp
12+
${CMAKE_CURRENT_LIST_DIR}/MemberNamesCheck.cpp
13+
${CMAKE_CURRENT_LIST_DIR}/NamespaceNamingCheck.cpp
14+
${CMAKE_CURRENT_LIST_DIR}/SizeofCheck.cpp
15+
)
16+
install(TARGETS clangTidyAliceO2Module LIBRARY DESTINATION lib)

clang-tidy-config.h

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)