-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
84 lines (76 loc) · 2.15 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
cmake_minimum_required(VERSION 2.6)
#configuration
project("demangler")
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin/)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib/)
option(DEMANGLER_BUILD_EXECUTABLE "Build a command-line executable to demangle" ON)
option(DEMANGLER_BUILD_TESTS "Build the demangler tests" ON)
set(WARNING_FLAGS
-Wall
-Wextra
-Wshadow
-Wnon-virtual-dtor
-pedantic
-Wold-style-cast
-Wcast-align
-Wunused
-Woverloaded-virtual
-Wpedantic
-Wconversion
-Wsign-conversion
-Wdouble-promotion
-Wformat=2
)
#includes directories
include_directories(
include/
)
#sources files
set(SRCS
src/demangler.cpp
src/details/CVQualifiers.cpp
src/details/node/ArrayType.cpp
src/details/node/BareFunctionType.cpp
src/details/node/BuiltinSubstitution.cpp
src/details/node/BuiltinType.cpp
src/details/node/Constructor.cpp
src/details/node/Decltype.cpp
src/details/Node.cpp
src/details/node/Encoding.cpp
src/details/node/Expression.cpp
src/details/node/ExprPrimary.cpp
src/details/node/Holder.cpp
src/details/node/LocalName.cpp
src/details/node/MangledName.cpp
src/details/node/Name.cpp
src/details/node/NestedName.cpp
src/details/node/Number.cpp
src/details/node/OperatorName.cpp
src/details/node/Prefix.cpp
src/details/node/SeqId.cpp
src/details/node/SourceName.cpp
src/details/node/Substitution.cpp
src/details/node/TemplateArg.cpp
src/details/node/TemplateArgs.cpp
src/details/node/TemplateParam.cpp
src/details/node/Type.cpp
src/details/node/UnqualifiedName.cpp
src/details/node/UnresolvedName.cpp
src/details/node/UnscopedName.cpp
src/details/node/UnscopedTemplateName.cpp
src/details/node/UserSubstitution.cpp
src/details/Parser.cpp
src/details/State.cpp
)
#binaries
add_library(demangler ${SRCS})
target_compile_options(demangler PRIVATE ${WARNING_FLAGS} -ggdb3)
set_property(TARGET demangler PROPERTY CXX_STANDARD 17)
set_property(TARGET demangler PROPERTY CMAKE_CXX_STANDARD_REQUIRED ON)
if (DEMANGLER_BUILD_EXECUTABLE)
add_executable(demangler_cli src/main.cpp)
target_link_libraries(demangler_cli demangler)
endif()
if (DEMANGLER_BUILD_TESTS)
add_subdirectory(tests)
endif()