-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
38 lines (31 loc) · 1.17 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
cmake_minimum_required(VERSION 3.0)
set(CMAKE_CXX_STANDARD 17)
if (CMAKE_BUILD_TYPE MATCHES "Debug")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
message("Debug mode")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
else ()
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
message("Release mode")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
endif ()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# clang does not support -mavx2 and stuff
message("Using ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -pthread")
else ()
message("Using non-Clang compiler ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2 -mpclmul -mbmi -mbmi2 -march=native -pthread")
endif ()
message("Compile flags: ${CMAKE_CXX_FLAGS}")
set(SOURCE_FILES
src/mercuryparser.cpp
src/recursive_descent_parser.cpp
src/shift_reduce_parser.cpp
src/tape.cpp
# src/tests.cpp
src/utils.cpp
src/parsestring.cpp
)
add_executable(main src/main.cpp ${SOURCE_FILES})
include(benchmark/CMakeLists.txt)