-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
66 lines (52 loc) · 1.74 KB
/
CMakeLists.txt
File metadata and controls
66 lines (52 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
cmake_minimum_required(VERSION 3.14.7) # FetchContent
cmake_policy(SET CMP0077 NEW)
cmake_policy(SET CMP0079 NEW)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
project(Taffo)
set(BUILD_SHARED_LIBS OFF)
include(TaffoOptions)
include(TaffoFetchDeps)
include(FindClangFormat)
find_package(LLVM REQUIRED CONFIG)
add_definitions(${LLVM_DEFINITIONS})
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
include_directories(${LLVM_INCLUDE_DIRS})
include(AddLLVM)
include(LLVMConfig)
include(HandleLLVMOptions)
if((${LLVM_VERSION_MAJOR} LESS 15) OR (${LLVM_VERSION_MAJOR} GREATER 22))
message(FATAL_ERROR
" LLVM version ${LLVM_VERSION_MAJOR} is not supported!\n"
" LLVM found at path: ${LLVM_DIR}")
endif()
message("LLVM found at path: ${LLVM_DIR}")
# to be kept in sync with LLVM!
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#set(CMAKE_CXX_CLANG_TIDY "clang-tidy-10;")
add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-covered-switch-default)
# build & install all tools by default
set(LLVM_BUILD_TOOLS ON)
# fix add_llvm_tool on macOS+Xcode
set(LLVM_MAIN_SRC_DIR ${CMAKE_SOURCE_DIR})
enable_testing()
include_directories(lib)
add_subdirectory(lib)
add_subdirectory(utils)
add_subdirectory(test)
add_subdirectory(tool)
if (TAFFO_UNITTESTS)
add_subdirectory(unittests)
endif()
# Set project git hooks only outside CI
if(NOT DEFINED ENV{GITHUB_WORKSPACE})
set(PROJECT_GIT_HOOKS_DIR "${CMAKE_SOURCE_DIR}/.githooks")
execute_process(
COMMAND git config --local core.hooksPath "${PROJECT_GIT_HOOKS_DIR}"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE _git_cfg_res
)
if(NOT _git_cfg_res EQUAL 0)
message(WARNING "Failed to set core.hooksPath (exit code ${_git_cfg_res})")
endif()
endif()