-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
204 lines (171 loc) · 6.06 KB
/
Copy pathCMakeLists.txt
File metadata and controls
204 lines (171 loc) · 6.06 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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
cmake_minimum_required(VERSION 3.25)
project(streamline VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 26)
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON")
option(BUILD_SHARED_LIBS "" ON)
### sources ###
set(${PROJECT_NAME}_HEADER_FILES
"algorithm/aligned_to.hpp"
"algorithm/lookup_table_hash.hpp"
"algorithm/minmax.hpp"
"containers/impl/array_data.hpp"
"containers/impl/hash_table.hpp"
"containers/impl/make_from_container.hpp"
"containers/impl/make_from_value.hpp"
"containers/impl/make_in_place.hpp"
"containers/impl/seed_or_index.hpp"
"containers/impl/tuple.hpp"
"containers/array.fwd.hpp"
"containers/array.hpp"
"containers/array.inl"
"containers/array.universal.inl"
"containers/generic_container_template_args.def.hpp"
"containers/initializer_list.hpp"
"containers/initializer_list.inl"
"containers/lookup_table.fwd.hpp"
"containers/lookup_table.hpp"
"containers/lookup_table.inl"
"containers/lookup_table.universal.inl"
"containers/key_value_pair.fwd.hpp"
"containers/key_value_pair.hpp"
"containers/key_value_pair.inl"
"containers/tuple.fwd.hpp"
"containers/tuple.hpp"
"containers/tuple.inl"
"containers/version.fwd.hpp"
"containers/version.hpp"
"diagnostics/abort.hpp"
"diagnostics/result.hpp"
"diagnostics/terminate.hpp"
"diagnostics/unreachable.hpp"
"functional/functor/address_of.hpp"
"functional/functor/comparison.hpp"
"functional/functor/construct_using.hpp"
"functional/functor/default_construct.hpp"
"functional/functor/default_delete.hpp"
"functional/functor/forward_construct.hpp"
"functional/functor/generic_stateful.hpp"
"functional/functor/generic_stateless.hpp"
"functional/functor/identity_index.hpp"
"functional/functor/identity.hpp"
"functional/functor/invoke_each_result.hpp"
"functional/functor/invoke_each.hpp"
"functional/functor/subscript.hpp"
"functional/invoke.hpp"
"memory/impl/deleter_wrapper.hpp"
"memory/impl/shared_counter.hpp"
"memory/impl/shared_ptr_base.hpp"
"memory/impl/shared_ptr_base.inl"
"memory/impl/unique_ptr_base.hpp"
"memory/impl/unique_ptr_base.inl"
"memory/align_value.hpp"
"memory/delete.hpp"
"memory/launder.hpp"
"memory/new_handler.hpp"
"memory/new.hpp"
"memory/reference_ptr.fwd.hpp"
"memory/reference_ptr.hpp"
"memory/shared_ptr.fwd.hpp"
"memory/shared_ptr.hpp"
"memory/shared_ptr.inl"
"memory/shared_ptr.universal.inl"
"memory/start_lifetime_as.hpp"
"memory/unique_ptr.fwd.hpp"
"memory/unique_ptr.hpp"
"memory/unique_ptr.inl"
"memory/unique_ptr.universal.inl"
"metaprogramming/impl/compounded_categories.hpp"
"metaprogramming/impl/isolated_categories.hpp"
"metaprogramming/impl/modifiers.hpp"
"metaprogramming/impl/relationships.hpp"
"metaprogramming/type_traits/compounded_categories.hpp"
"metaprogramming/type_traits/extensions.hpp"
"metaprogramming/type_traits/isolated_categories.hpp"
"metaprogramming/type_traits/relationships.hpp"
"metaprogramming/type_traits/supported_operations.hpp"
"metaprogramming/common_type.hpp"
"metaprogramming/conditional.hpp"
"metaprogramming/container_traits.fwd.hpp"
"metaprogramming/container_traits.hpp"
"metaprogramming/declval.hpp"
"metaprogramming/empty_t.hpp"
"metaprogramming/forward.hpp"
"metaprogramming/in_place.hpp"
"metaprogramming/integer_sequence.hpp"
"metaprogramming/constant.hpp"
"metaprogramming/invoke_return_type.hpp"
"metaprogramming/move.hpp"
"metaprogramming/pack_indices_of_type.hpp"
"metaprogramming/tuple_traits.fwd.hpp"
"metaprogramming/tuple_traits.hpp"
"metaprogramming/type_identity.hpp"
"metaprogramming/type_modifiers.hpp"
"metaprogramming/type_of_pack_element.hpp"
"metaprogramming/underlying_type.hpp"
"numeric/impl/numeric_traits_base.hpp"
"numeric/int.hpp"
"numeric/numeric_traits.hpp"
"universal/get.hpp"
"universal/make_deduced.hpp"
"universal/make.hpp"
"universal/swap.hpp"
)
set(${PROJECT_NAME}_STD_HEADER_FILES
"array"
"atomic"
"cassert"
"cstddef"
"cstdint"
"cstdio"
"cstdlib"
"cstring"
"exception"
"new"
"functional"
"initializer_list"
"iosfwd"
"limits"
"memory"
"stdexcept"
"string"
"tuple"
"type_traits"
"utility"
"version"
)
set(${PROJECT_NAME}_SOURCE_FILES
"memory/delete.cpp"
"memory/new.cpp"
)
### targets ###
list(TRANSFORM ${PROJECT_NAME}_HEADER_FILES PREPEND "include/${PROJECT_NAME}/")
list(TRANSFORM ${PROJECT_NAME}_STD_HEADER_FILES PREPEND "include/c++/scl/")
list(TRANSFORM ${PROJECT_NAME}_SOURCE_FILES PREPEND "src/${PROJECT_NAME}/")
#set(LIBRARY_TYPE INTERFACE)
#add_library(${PROJECT_NAME} INTERFACE)
set(LIBRARY_TYPE PUBLIC)
add_library(${PROJECT_NAME} ${${PROJECT_NAME}_SOURCE_FILES})
target_sources(${PROJECT_NAME} ${LIBRARY_TYPE} FILE_SET ${PROJECT_NAME}_HEADERS TYPE HEADERS BASE_DIRS "include" FILES ${${PROJECT_NAME}_HEADER_FILES})
target_sources(${PROJECT_NAME} ${LIBRARY_TYPE} FILE_SET ${PROJECT_NAME}_STD_HEADERS TYPE HEADERS BASE_DIRS "include" FILES ${${PROJECT_NAME}_STD_HEADER_FILES})
### compiler args ###
#target_compile_options(${PROJECT_NAME} ${LIBRARY_TYPE} "-march=native")
target_compile_options(${PROJECT_NAME} ${LIBRARY_TYPE} "-fno-exceptions" "-fno-rtti" "-nostdinc++" "-Wall" "-Wextra" "$<$<CONFIG:RELEASE>:-Werror>")
target_compile_options(${PROJECT_NAME} ${LIBRARY_TYPE} "$<$<CONFIG:RELEASE>:-O3>" "$<$<CONFIG:RELEASE>:-ffast-math>")
target_compile_options(${PROJECT_NAME} ${LIBRARY_TYPE} "$<$<CONFIG:DEBUG>:-O0>" "$<$<CONFIG:DEBUG>:-g>")
target_link_options(${PROJECT_NAME} ${LIBRARY_TYPE} "-nostdlib++")
### self include streamline compatibility layer directory (for 3rd party libraries) ###
cmake_path(SET SELF_INC_STD_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/c++/scl")
file(TO_NATIVE_PATH "${SELF_INC_STD_CMAKE_DIR}" SELF_INC_STD_DIR)
target_include_directories(${PROJECT_NAME} SYSTEM AFTER ${LIBRARY_TYPE} "${SELF_INC_STD_DIR}")
message(STATUS "Including self std directory: ${SELF_INC_STD_DIR}")
## pkgconfig
configure_file(
"streamline.pc.in"
"streamline.pc"
@ONLY)
### test executables ###
#add_subdirectory(test)
### install ###
install(TARGETS ${PROJECT_NAME} FILE_SET ${PROJECT_NAME}_HEADERS)
install(TARGETS ${PROJECT_NAME} FILE_SET ${PROJECT_NAME}_STD_HEADERS)
install(FILES ${PROJECT_BINARY_DIR}/streamline.pc DESTINATION lib/pkgconfig/)