-
Notifications
You must be signed in to change notification settings - Fork 10
/
CMakeLists.txt
449 lines (429 loc) · 20.8 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
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
include(CheckTypeSize)
set(CMAKE_EXTRA_INCLUDE_FILES "time.h")
CHECK_TYPE_SIZE("time_t" SIZEOF_TIME_T)
if(SIZEOF_TIME_T LESS 8)
message(
WARNING
"time_t is not 64 bits, so printing of years will only be accurate near the epoch")
endif()
add_subdirectory(containers)
add_subdirectory(operations)
add_subdirectory(port)
QS_PROTOBUF_GENERATE_CPP(types_TypedValue_proto_srcs types_TypedValue_proto_hdrs TypedValue.proto)
QS_PROTOBUF_GENERATE_CPP(types_Type_proto_srcs types_Type_proto_hdrs Type.proto)
# Declare micro-libs:
add_library(quickstep_types_CharType CharType.cpp CharType.hpp)
add_library(quickstep_types_DateOperatorOverloads ../empty_src.cpp DateOperatorOverloads.hpp)
add_library(quickstep_types_DateType DateType.cpp DateType.hpp)
add_library(quickstep_types_DatetimeIntervalType DatetimeIntervalType.cpp DatetimeIntervalType.hpp)
add_library(quickstep_types_DatetimeLit ../empty_src.cpp DatetimeLit.hpp)
add_library(quickstep_types_DatetimeType DatetimeType.cpp DatetimeType.hpp)
add_library(quickstep_types_DoubleType DoubleType.cpp DoubleType.hpp)
add_library(quickstep_types_FloatType FloatType.cpp FloatType.hpp)
add_library(quickstep_types_IntType IntType.cpp IntType.hpp)
add_library(quickstep_types_IntervalLit ../empty_src.cpp IntervalLit.hpp)
add_library(quickstep_types_IntervalParser IntervalParser.cpp IntervalParser.hpp)
add_library(quickstep_types_LongType LongType.cpp LongType.hpp)
add_library(quickstep_types_NullCoercibilityCheckMacro ../empty_src.cpp NullCoercibilityCheckMacro.hpp)
add_library(quickstep_types_NullType ../empty_src.cpp NullType.hpp)
add_library(quickstep_types_NumericSuperType ../empty_src.cpp NumericSuperType.hpp)
add_library(quickstep_types_NumericTypeUnifier ../empty_src.cpp NumericTypeUnifier.hpp)
add_library(quickstep_types_Type Type.cpp Type.hpp)
add_library(quickstep_types_TypeErrors ../empty_src.cpp TypeErrors.hpp)
add_library(quickstep_types_TypeFactory TypeFactory.cpp TypeFactory.hpp)
add_library(quickstep_types_TypeID TypeID.cpp TypeID.hpp)
add_library(quickstep_types_Type_proto ${types_Type_proto_srcs})
add_library(quickstep_types_TypedValue TypedValue.cpp TypedValue.hpp)
add_library(quickstep_types_TypedValue_proto ${types_TypedValue_proto_srcs})
add_library(quickstep_types_VarCharType VarCharType.cpp VarCharType.hpp)
add_library(quickstep_types_YearMonthIntervalType YearMonthIntervalType.cpp YearMonthIntervalType.hpp)
# Link dependencies:
target_link_libraries(quickstep_types_CharType
glog
quickstep_types_NullCoercibilityCheckMacro
quickstep_types_Type
quickstep_types_TypeID
quickstep_types_Type_proto
quickstep_types_TypedValue
quickstep_types_port_strnlen
quickstep_utility_Macros
quickstep_utility_PtrMap)
target_link_libraries(quickstep_types_DateOperatorOverloads
glog
quickstep_types_DatetimeLit
quickstep_types_IntervalLit
quickstep_types_port_gmtime_r
quickstep_types_port_timegm)
target_link_libraries(quickstep_types_DateType
glog
quickstep_types_DatetimeLit
quickstep_types_NullCoercibilityCheckMacro
quickstep_types_Type
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_utility_CheckSnprintf
quickstep_utility_Macros)
target_link_libraries(quickstep_types_DatetimeIntervalType
glog
quickstep_types_IntervalLit
quickstep_types_IntervalParser
quickstep_types_NullCoercibilityCheckMacro
quickstep_types_Type
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_utility_CheckSnprintf
quickstep_utility_Macros)
target_link_libraries(quickstep_types_DatetimeLit
quickstep_types_port_gmtime_r)
target_link_libraries(quickstep_types_DatetimeType
glog
quickstep_types_DatetimeLit
quickstep_types_NullCoercibilityCheckMacro
quickstep_types_Type
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_types_port_gmtime_r
quickstep_types_port_timegm
quickstep_utility_CheckSnprintf
quickstep_utility_Macros)
target_link_libraries(quickstep_types_DoubleType
glog
quickstep_types_NullCoercibilityCheckMacro
quickstep_types_NumericSuperType
quickstep_types_Type
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_utility_EqualsAnyConstant
quickstep_utility_Macros)
target_link_libraries(quickstep_types_FloatType
glog
quickstep_types_NullCoercibilityCheckMacro
quickstep_types_NumericSuperType
quickstep_types_Type
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_utility_EqualsAnyConstant
quickstep_utility_Macros)
target_link_libraries(quickstep_types_IntType
glog
quickstep_types_NullCoercibilityCheckMacro
quickstep_types_NumericSuperType
quickstep_types_Type
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_utility_Macros)
target_link_libraries(quickstep_types_IntervalLit
glog
quickstep_utility_Macros)
target_link_libraries(quickstep_types_IntervalParser
quickstep_types_IntervalLit
quickstep_utility_Macros)
target_link_libraries(quickstep_types_LongType
glog
quickstep_types_NullCoercibilityCheckMacro
quickstep_types_NumericSuperType
quickstep_types_Type
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_utility_EqualsAnyConstant
quickstep_utility_Macros)
target_link_libraries(quickstep_types_NullCoercibilityCheckMacro
quickstep_types_Type
quickstep_types_TypeID)
target_link_libraries(quickstep_types_NullType
glog
quickstep_types_Type
quickstep_types_TypeID
quickstep_utility_Macros)
target_link_libraries(quickstep_types_NumericSuperType
quickstep_types_NullCoercibilityCheckMacro
quickstep_types_Type
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_utility_Macros)
target_link_libraries(quickstep_types_Type
glog
quickstep_types_TypeID
quickstep_types_Type_proto
quickstep_types_TypedValue
quickstep_utility_Macros)
target_link_libraries(quickstep_types_TypeFactory
glog
quickstep_types_CharType
quickstep_types_DateType
quickstep_types_DatetimeIntervalType
quickstep_types_DatetimeType
quickstep_types_DoubleType
quickstep_types_FloatType
quickstep_types_IntType
quickstep_types_LongType
quickstep_types_NullType
quickstep_types_Type
quickstep_types_TypeID
quickstep_types_Type_proto
quickstep_types_VarCharType
quickstep_types_YearMonthIntervalType
quickstep_utility_Macros)
target_link_libraries(quickstep_types_Type_proto
${PROTOBUF_LIBRARY})
target_link_libraries(quickstep_types_TypedValue
farmhash
glog
quickstep_types_DatetimeLit
quickstep_types_IntervalLit
quickstep_types_TypeID
quickstep_types_Type_proto
quickstep_types_TypedValue_proto
quickstep_types_port_strnlen
quickstep_utility_HashPair
quickstep_utility_Macros)
target_link_libraries(quickstep_types_TypedValue_proto
${PROTOBUF_LIBRARY}
quickstep_types_Type_proto)
target_link_libraries(quickstep_types_VarCharType
glog
quickstep_types_NullCoercibilityCheckMacro
quickstep_types_Type
quickstep_types_TypeID
quickstep_types_Type_proto
quickstep_types_TypedValue
quickstep_types_port_strnlen
quickstep_utility_Macros
quickstep_utility_PtrMap)
target_link_libraries(quickstep_types_YearMonthIntervalType
glog
quickstep_types_IntervalLit
quickstep_types_IntervalParser
quickstep_types_NullCoercibilityCheckMacro
quickstep_types_Type
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_utility_CheckSnprintf
quickstep_utility_Macros)
# Module all-in-one library:
add_library(quickstep_types ../empty_src.cpp TypesModule.hpp)
target_link_libraries(quickstep_types
quickstep_types_CharType
quickstep_types_DateOperatorOverloads
quickstep_types_DateType
quickstep_types_DatetimeIntervalType
quickstep_types_DatetimeLit
quickstep_types_DatetimeType
quickstep_types_DoubleType
quickstep_types_FloatType
quickstep_types_IntType
quickstep_types_IntervalLit
quickstep_types_IntervalParser
quickstep_types_LongType
quickstep_types_NullCoercibilityCheckMacro
quickstep_types_NullType
quickstep_types_NumericSuperType
quickstep_types_NumericTypeUnifier
quickstep_types_Type
quickstep_types_TypeErrors
quickstep_types_TypeFactory
quickstep_types_TypeID
quickstep_types_Type_proto
quickstep_types_TypedValue
quickstep_types_TypedValue_proto
quickstep_types_VarCharType
quickstep_types_YearMonthIntervalType
quickstep_types_containers
quickstep_types_operations
quickstep_types_port)
# Tests:
add_library(quickstep_types_tests_TypeTest_common
../empty_src.cpp
"${CMAKE_CURRENT_SOURCE_DIR}/tests/TypeTest_common.hpp")
target_link_libraries(quickstep_types_tests_TypeTest_common
gtest
gtest_main
quickstep_types_DoubleType
quickstep_types_FloatType
quickstep_types_IntType
quickstep_types_LongType
quickstep_types_NullType
quickstep_types_Type
quickstep_types_TypeFactory
quickstep_types_TypeID
quickstep_types_TypedValue)
add_executable(CharType_unittest "${CMAKE_CURRENT_SOURCE_DIR}/tests/CharType_unittest.cpp")
target_link_libraries(CharType_unittest
gtest
gtest_main
quickstep_types_Type
quickstep_types_TypeFactory
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_types_tests_TypeTest_common
quickstep_utility_MemStream)
add_test(CharType_unittest CharType_unittest)
add_executable(DateType_unittest "${CMAKE_CURRENT_SOURCE_DIR}/tests/DateType_unittest.cpp")
target_link_libraries(DateType_unittest
gtest
gtest_main
quickstep_types_DateType
quickstep_types_DatetimeLit
quickstep_types_NullType
quickstep_types_Type
quickstep_types_TypeFactory
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_types_tests_TypeTest_common
quickstep_utility_MemStream)
add_test(DateType_unittest DateType_unittest)
add_executable(DatetimeIntervalType_unittest
"${CMAKE_CURRENT_SOURCE_DIR}/tests/DatetimeIntervalType_unittest.cpp")
target_link_libraries(DatetimeIntervalType_unittest
gtest
gtest_main
quickstep_types_DatetimeIntervalType
quickstep_types_IntervalLit
quickstep_types_NullType
quickstep_types_Type
quickstep_types_TypeFactory
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_types_tests_TypeTest_common
quickstep_utility_MemStream)
add_test(DatetimeIntervalType_unittest DatetimeIntervalType_unittest)
add_executable(DatetimeType_unittest "${CMAKE_CURRENT_SOURCE_DIR}/tests/DatetimeType_unittest.cpp")
target_link_libraries(DatetimeType_unittest
gtest
gtest_main
quickstep_types_DatetimeLit
quickstep_types_DatetimeType
quickstep_types_NullType
quickstep_types_Type
quickstep_types_TypeFactory
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_types_tests_TypeTest_common
quickstep_utility_MemStream)
add_test(DatetimeType_unittest DatetimeType_unittest)
add_executable(DoubleType_unittest "${CMAKE_CURRENT_SOURCE_DIR}/tests/DoubleType_unittest.cpp")
target_link_libraries(DoubleType_unittest
glog
gtest
gtest_main
quickstep_types_DoubleType
quickstep_types_Type
quickstep_types_TypeFactory
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_types_tests_TypeTest_common
quickstep_utility_MemStream)
add_test(DoubleType_unittest DoubleType_unittest)
add_executable(FloatType_unittest "${CMAKE_CURRENT_SOURCE_DIR}/tests/FloatType_unittest.cpp")
target_link_libraries(FloatType_unittest
glog
gtest
gtest_main
quickstep_types_FloatType
quickstep_types_Type
quickstep_types_TypeFactory
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_types_tests_TypeTest_common
quickstep_utility_MemStream)
add_test(FloatType_unittest FloatType_unittest)
add_executable(IntType_unittest "${CMAKE_CURRENT_SOURCE_DIR}/tests/IntType_unittest.cpp")
target_link_libraries(IntType_unittest
gtest
gtest_main
quickstep_types_IntType
quickstep_types_Type
quickstep_types_TypeFactory
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_types_tests_TypeTest_common
quickstep_utility_MemStream)
add_test(IntType_unittest IntType_unittest)
add_executable(LongType_unittest "${CMAKE_CURRENT_SOURCE_DIR}/tests/LongType_unittest.cpp")
target_link_libraries(LongType_unittest
gtest
gtest_main
quickstep_types_LongType
quickstep_types_Type
quickstep_types_TypeFactory
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_types_tests_TypeTest_common
quickstep_utility_MemStream)
add_test(LongType_unittest LongType_unittest)
add_executable(Type_unittest "${CMAKE_CURRENT_SOURCE_DIR}/tests/Type_unittest.cpp")
target_link_libraries(Type_unittest
gtest
gtest_main
quickstep_types_CharType
quickstep_types_Type
quickstep_types_TypeFactory
quickstep_types_TypeID
quickstep_types_Type_proto
quickstep_types_VarCharType
quickstep_utility_Macros)
add_test(Type_unittest Type_unittest)
add_executable(TypedValue_unittest "${CMAKE_CURRENT_SOURCE_DIR}/tests/TypedValue_unittest.cpp")
target_link_libraries(TypedValue_unittest
gtest
gtest_main
quickstep_types_DatetimeLit
quickstep_types_IntervalLit
quickstep_types_Type
quickstep_types_TypeFactory
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_types_TypedValue_proto
quickstep_utility_Macros
quickstep_utility_ScopedBuffer)
add_test(TypedValue_unittest TypedValue_unittest)
# We intentionally test self-move of TypedValues in the unittest. This disables
# compiler warnings about self-moves in the test ONLY.
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-Wno-self-move" COMPILER_HAS_WNO_SELF_MOVE)
if (COMPILER_HAS_WNO_SELF_MOVE)
set_target_properties(TypedValue_unittest PROPERTIES COMPILE_FLAGS "-Wno-self-move")
endif()
add_executable(VarCharType_unittest
"${CMAKE_CURRENT_SOURCE_DIR}/tests/VarCharType_unittest.cpp")
target_link_libraries(VarCharType_unittest
gtest
gtest_main
quickstep_types_Type
quickstep_types_TypeFactory
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_types_tests_TypeTest_common
quickstep_utility_MemStream)
add_test(VarCharType_unittest VarCharType_unittest)
add_executable(YearMonthIntervalType_unittest
"${CMAKE_CURRENT_SOURCE_DIR}/tests/YearMonthIntervalType_unittest.cpp")
target_link_libraries(YearMonthIntervalType_unittest
gtest
gtest_main
quickstep_types_IntervalLit
quickstep_types_NullType
quickstep_types_Type
quickstep_types_TypeFactory
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_types_YearMonthIntervalType
quickstep_types_tests_TypeTest_common
quickstep_utility_MemStream)
add_test(YearMonthIntervalType_unittest YearMonthIntervalType_unittest)