-
Notifications
You must be signed in to change notification settings - Fork 171
/
Copy pathCMakeLists.txt
130 lines (126 loc) · 4.89 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Copyright (C) 2017-2023 Jonathan Müller and cppast contributors
# SPDX-License-Identifier: MIT
# found in the top-level directory of this distribution.
set(detail_header
../include/cppast/detail/assert.hpp
../include/cppast/detail/intrusive_list.hpp)
set(header
../include/cppast/code_generator.hpp
../include/cppast/compile_config.hpp
../include/cppast/cpp_alias_template.hpp
../include/cppast/cpp_array_type.hpp
../include/cppast/cpp_attribute.hpp
../include/cppast/cpp_class.hpp
../include/cppast/cpp_class_template.hpp
../include/cppast/cpp_concept.hpp
../include/cppast/cpp_decltype_type.hpp
../include/cppast/cpp_entity.hpp
../include/cppast/cpp_entity_container.hpp
../include/cppast/cpp_entity_index.hpp
../include/cppast/cpp_entity_kind.hpp
../include/cppast/cpp_entity_ref.hpp
../include/cppast/cpp_enum.hpp
../include/cppast/cpp_expression.hpp
../include/cppast/cpp_file.hpp
../include/cppast/cpp_forward_declarable.hpp
../include/cppast/cpp_friend.hpp
../include/cppast/cpp_function.hpp
../include/cppast/cpp_function_template.hpp
../include/cppast/cpp_function_type.hpp
../include/cppast/cpp_language_linkage.hpp
../include/cppast/cpp_member_function.hpp
../include/cppast/cpp_member_variable.hpp
../include/cppast/cpp_namespace.hpp
../include/cppast/cpp_preprocessor.hpp
../include/cppast/cpp_static_assert.hpp
../include/cppast/cpp_storage_class_specifiers.hpp
../include/cppast/cpp_template.hpp
../include/cppast/cpp_template_parameter.hpp
../include/cppast/cpp_token.hpp
../include/cppast/cpp_type.hpp
../include/cppast/cpp_type_alias.hpp
../include/cppast/cpp_variable.hpp
../include/cppast/cpp_variable_base.hpp
../include/cppast/cpp_variable_template.hpp
../include/cppast/diagnostic.hpp
../include/cppast/diagnostic_logger.hpp
../include/cppast/cppast_fwd.hpp
../include/cppast/libclang_parser.hpp
../include/cppast/parser.hpp
../include/cppast/visitor.hpp)
set(source
code_generator.cpp
cpp_alias_template.cpp
cpp_attribute.cpp
cpp_class.cpp
cpp_class_template.cpp
cpp_concept.cpp
cpp_entity.cpp
cpp_entity_index.cpp
cpp_entity_kind.cpp
cpp_enum.cpp
cpp_expression.cpp
cpp_file.cpp
cpp_forward_declarable.cpp
cpp_friend.cpp
cpp_function.cpp
cpp_function_template.cpp
cpp_language_linkage.cpp
cpp_member_function.cpp
cpp_member_variable.cpp
cpp_namespace.cpp
cpp_preprocessor.cpp
cpp_static_assert.cpp
cpp_template_parameter.cpp
cpp_token.cpp
cpp_type.cpp
cpp_type_alias.cpp
cpp_variable.cpp
cpp_variable_template.cpp
diagnostic_logger.cpp
visitor.cpp)
set(libclang_source
libclang/class_parser.cpp
libclang/concept_parser.cpp
libclang/cxtokenizer.cpp
libclang/cxtokenizer.hpp
libclang/debug_helper.cpp
libclang/debug_helper.hpp
libclang/enum_parser.cpp
libclang/expression_parser.cpp
libclang/friend_parser.cpp
libclang/function_parser.cpp
libclang/language_linkage_parser.cpp
libclang/libclang_parser.cpp
libclang/libclang_visitor.hpp
libclang/namespace_parser.cpp
libclang/parse_error.hpp
libclang/parse_functions.cpp
libclang/parse_functions.hpp
libclang/preprocessor.cpp
libclang/preprocessor.hpp
libclang/raii_wrapper.hpp
libclang/template_parser.cpp
libclang/type_parser.cpp
libclang/variable_parser.cpp)
add_library(cppast ${detail_header} ${header} ${source} ${libclang_source})
target_compile_features(cppast PUBLIC cxx_std_11)
target_include_directories(cppast PRIVATE ../include SYSTEM INTERFACE ../include)
target_link_libraries(cppast PUBLIC type_safe _cppast_tiny_process _cppast_libclang)
target_compile_definitions(cppast PUBLIC
CPPAST_VERSION_MINOR="${cppast_VERSION_MINOR}"
CPPAST_VERSION_MAJOR="${cppast_VERSION_MAJOR}"
CPPAST_VERSION_STRING="${cppast_VERSION}")
if(${is_top_level_project})
target_compile_options(cppast PRIVATE
# clang/GCC warnings
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:
-pedantic-errors -Werror -Wall -Wextra -Wconversion -Wsign-conversion>
# disable noexcept type warning on GCC
$<$<CXX_COMPILER_ID:GNU>: -Wno-noexcept-type>
# MSVC warnings
$<$<CXX_COMPILER_ID:MSVC>:
/W3>)
endif()
install(TARGETS cppast)
install(DIRECTORY ../include/ DESTINATION include)