|
1 | 1 | cmake_minimum_required(VERSION 3.4.3) |
2 | 2 | enable_testing() |
3 | 3 |
|
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) |
22 | 5 |
|
23 | | - # set the compiler flags to match llvm |
24 | | - include(HandleLLVMOptions) |
25 | | - endif() |
| 6 | +# find clang + llvm |
| 7 | +find_package(Clang REQUIRED CONFIG) |
26 | 8 |
|
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) |
30 | 12 |
|
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() |
33 | 16 |
|
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") |
36 | 20 |
|
37 | | -set(LLVM_LINK_COMPONENTS |
38 | | - Support |
39 | | - ) |
| 21 | +# include Clang macros (unfortunately they are not part of the cmake installation) |
| 22 | +include(AddClang) |
40 | 23 |
|
41 | 24 | # the main executable |
42 | 25 | add_subdirectory(tool) |
43 | 26 |
|
44 | 27 | # the specific aliceO2 checker code |
45 | 28 | add_subdirectory(aliceO2) |
46 | | -# the specific reporting tools code |
47 | | -add_subdirectory(reporting) |
48 | | - |
49 | | -# plugin |
50 | | -add_subdirectory(plugin) |
51 | 29 |
|
52 | 30 | # for testing |
53 | 31 | add_subdirectory(test) |
54 | 32 |
|
55 | 33 | # some extra utilities |
56 | 34 | 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() |
0 commit comments