-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·113 lines (89 loc) · 4.06 KB
/
CMakeLists.txt
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
cmake_minimum_required(VERSION 3.7)
project(vectorized_regex LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -fsanitize=address -mavx2")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_DEBUG} -O2 -mavx2")
find_package(Threads REQUIRED)
set(THREADS_PREFER_PTHREAD_FLAG ON)
include("${CMAKE_SOURCE_DIR}/cmake/clang-tidy.cmake")
include("${CMAKE_SOURCE_DIR}/vendor/llvm.cmake")
# ---------------------------------------------------------------------------
# Includes
# ---------------------------------------------------------------------------
include_directories(
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/perfevent
)
include_directories(SYSTEM
${LLVM_INCLUDE_DIRS}
)
# ---------------------------------------------------------------------------
# Sources
# ---------------------------------------------------------------------------
set(INCLUDE_H
"${CMAKE_SOURCE_DIR}/include/stream/bit_stream.h"
"${CMAKE_SOURCE_DIR}/include/parser/re_parser.h"
"${CMAKE_SOURCE_DIR}/include/parser/cc.h"
"${CMAKE_SOURCE_DIR}/include/codegen/cc_compiler.h"
"${CMAKE_SOURCE_DIR}/include/codegen/expression_compiler_cpp.h"
"${CMAKE_SOURCE_DIR}/include/codegen/expression_compiler_llvm.h"
"${CMAKE_SOURCE_DIR}/include/codegen/expression_builder.h"
"${CMAKE_SOURCE_DIR}/include/codegen/operation_builder.h"
"${CMAKE_SOURCE_DIR}/include/codegen/operation_compiler.h"
"${CMAKE_SOURCE_DIR}/include/codegen/parabix_compiler.h"
"${CMAKE_SOURCE_DIR}/include/codegen/ast.h"
"${CMAKE_SOURCE_DIR}/include/codegen/jit.h"
"${CMAKE_SOURCE_DIR}/include/operations/marker.h"
"${CMAKE_SOURCE_DIR}/include/operations/simd.h"
"${CMAKE_SOURCE_DIR}/include/parabix/bit.h"
"${CMAKE_SOURCE_DIR}/include/parabix/parabix.h"
)
set(SRC_CC
"${CMAKE_SOURCE_DIR}/src/stream/bit_stream.cc"
"${CMAKE_SOURCE_DIR}/src/parser/re_parser.cc"
"${CMAKE_SOURCE_DIR}/src/codegen/cc_compiler.cc"
"${CMAKE_SOURCE_DIR}/src/codegen/expression_compiler_cpp.cc"
"${CMAKE_SOURCE_DIR}/src/codegen/expression_compiler_llvm.cc"
"${CMAKE_SOURCE_DIR}/src/codegen/expression_builder.cc"
"${CMAKE_SOURCE_DIR}/src/codegen/operation_builder.cc"
"${CMAKE_SOURCE_DIR}/src/codegen/operation_compiler.cc"
"${CMAKE_SOURCE_DIR}/src/codegen/parabix_compiler.cc"
"${CMAKE_SOURCE_DIR}/src/codegen/jit.cc"
"${CMAKE_SOURCE_DIR}/src/parabix/parabix.cc"
"${CMAKE_SOURCE_DIR}/tools/vgrep.cc"
)
set(TEST_CC
"${CMAKE_SOURCE_DIR}/test/bit_stream.cc"
)
# ---------------------------------------------------------------------------
# Targets
# ---------------------------------------------------------------------------
add_library(regex_vectorization STATIC ${SRC_CC})
target_link_libraries(regex_vectorization Threads::Threads ${LLVM_LIBS} ${LLVM_LDFLAGS})
add_executable(vgrep tools/vgrep.cc)
target_link_libraries(vgrep regex_vectorization)
add_executable(vgrep_block tools/vgrep_block.cc)
target_link_libraries(vgrep_block regex_vectorization)
add_executable(vgrep_llvm tools/vgrep_llvm.cc)
target_link_libraries(vgrep_llvm regex_vectorization)
add_executable(benchmark tools/benchmark.cc)
target_link_libraries(benchmark regex_vectorization)
add_executable(generator generator/main.cc)
target_link_libraries(generator regex_vectorization)
# ---------------------------------------------------------------------------
# Tests
# ---------------------------------------------------------------------------
add_executable(tester test/tester.cc ${TEST_CC})
target_link_libraries(tester regex_vectorization gtest Threads::Threads)
enable_testing()
add_test(regex_vectorization tester)
# ---------------------------------------------------------------------------
# Linting
# ---------------------------------------------------------------------------
add_clang_tidy_target(src_linting "${SRC_CC}")
add_clang_tidy_target(include_linting "${INCLUDE_H}")
add_custom_target(lint)
list(APPEND lint_targets include_linting src_linting)
add_dependencies(lint ${lint_targets})