forked from apache/arrow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
170 lines (147 loc) · 5.35 KB
/
Copy pathCMakeLists.txt
File metadata and controls
170 lines (147 loc) · 5.35 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
# 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.
add_custom_target(arrow_dataset)
arrow_install_all_headers("arrow/dataset")
set(ARROW_DATASET_SRCS
dataset.cc
dataset_writer.cc
discovery.cc
file_base.cc
file_ipc.cc
partition.cc
plan.cc
projector.cc
scanner.cc
scan_node.cc)
if(ARROW_PARQUET)
set(ARROW_DATASET_PKG_CONFIG_REQUIRES parquet)
else()
set(ARROW_DATASET_PKG_CONFIG_REQUIRES arrow)
endif()
set(ARROW_DATASET_STATIC_LINK_LIBS)
set(ARROW_DATASET_SHARED_LINK_LIBS)
set(ARROW_DATASET_STATIC_INSTALL_INTERFACE_LIBS)
set(ARROW_DATASET_SHARED_INSTALL_INTERFACE_LIBS)
if(ARROW_CSV)
set(ARROW_DATASET_SRCS ${ARROW_DATASET_SRCS} file_csv.cc)
endif()
if(ARROW_ORC)
set(ARROW_DATASET_SRCS ${ARROW_DATASET_SRCS} file_orc.cc)
endif()
if(ARROW_PARQUET)
list(APPEND ARROW_DATASET_STATIC_LINK_LIBS parquet_static)
list(APPEND ARROW_DATASET_SHARED_LINK_LIBS parquet_shared)
list(APPEND ARROW_DATASET_STATIC_INSTALL_INTERFACE_LIBS Parquet::parquet_static)
list(APPEND ARROW_DATASET_SHARED_INSTALL_INTERFACE_LIBS Parquet::parquet_shared)
list(APPEND ARROW_DATASET_SRCS file_parquet.cc)
list(APPEND ARROW_DATASET_PRIVATE_INCLUDES ${PROJECT_SOURCE_DIR}/src/parquet)
else()
list(APPEND ARROW_DATASET_STATIC_INSTALL_INTERFACE_LIBS Arrow::arrow_static)
list(APPEND ARROW_DATASET_SHARED_INSTALL_INTERFACE_LIBS Arrow::arrow_shared)
endif()
list(APPEND ARROW_DATASET_STATIC_LINK_LIBS arrow_static ${ARROW_STATIC_LINK_LIBS})
list(APPEND ARROW_DATASET_SHARED_LINK_LIBS arrow_shared)
add_arrow_lib(arrow_dataset
CMAKE_PACKAGE_NAME
ArrowDataset
PKG_CONFIG_NAME
arrow-dataset
OUTPUTS
ARROW_DATASET_LIBRARIES
SOURCES
${ARROW_DATASET_SRCS}
PRECOMPILED_HEADERS
"$<$<COMPILE_LANGUAGE:CXX>:arrow/dataset/pch.h>"
DEPENDENCIES
toolchain
PRIVATE_INCLUDES
${ARROW_DATASET_PRIVATE_INCLUDES}
SHARED_LINK_LIBS
${ARROW_DATASET_SHARED_LINK_LIBS}
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_DATASET_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_LINK_LIBS
${ARROW_DATASET_STATIC_LINK_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
${ARROW_DATASET_STATIC_INSTALL_INTERFACE_LIBS})
if(ARROW_BUILD_STATIC AND WIN32)
target_compile_definitions(arrow_dataset_static PUBLIC ARROW_DS_STATIC)
endif()
if(ARROW_TEST_LINKAGE STREQUAL "static")
set(ARROW_DATASET_TEST_LINK_LIBS arrow_dataset_static ${ARROW_TEST_STATIC_LINK_LIBS})
else()
set(ARROW_DATASET_TEST_LINK_LIBS arrow_dataset_shared ${ARROW_TEST_SHARED_LINK_LIBS})
endif()
foreach(LIB_TARGET ${ARROW_DATASET_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_DS_EXPORTING)
endforeach()
# Adding unit tests part of the "dataset" portion of the test suite
function(ADD_ARROW_DATASET_TEST REL_TEST_NAME)
set(options)
set(one_value_args PREFIX)
set(multi_value_args LABELS)
cmake_parse_arguments(ARG
"${options}"
"${one_value_args}"
"${multi_value_args}"
${ARGN})
if(ARG_PREFIX)
set(PREFIX ${ARG_PREFIX})
else()
set(PREFIX "arrow-dataset")
endif()
if(ARG_LABELS)
set(LABELS ${ARG_LABELS})
else()
set(LABELS "arrow_dataset")
endif()
add_arrow_test(${REL_TEST_NAME}
EXTRA_LINK_LIBS
${ARROW_DATASET_TEST_LINK_LIBS}
PREFIX
${PREFIX}
LABELS
${LABELS}
${ARG_UNPARSED_ARGUMENTS})
endfunction()
add_arrow_dataset_test(dataset_test)
add_arrow_dataset_test(dataset_writer_test)
add_arrow_dataset_test(discovery_test)
add_arrow_dataset_test(file_ipc_test)
add_arrow_dataset_test(file_test)
add_arrow_dataset_test(partition_test)
add_arrow_dataset_test(scanner_test)
if(ARROW_CSV)
add_arrow_dataset_test(file_csv_test)
endif()
if(ARROW_ORC)
add_arrow_dataset_test(file_orc_test)
endif()
if(ARROW_PARQUET)
add_arrow_dataset_test(file_parquet_test)
endif()
if(ARROW_BUILD_BENCHMARKS)
add_arrow_benchmark(file_benchmark PREFIX "arrow-dataset")
add_arrow_benchmark(scanner_benchmark PREFIX "arrow-dataset")
if(ARROW_BUILD_STATIC)
target_link_libraries(arrow-dataset-file-benchmark PUBLIC arrow_dataset_static)
target_link_libraries(arrow-dataset-scanner-benchmark PUBLIC arrow_dataset_static)
else()
target_link_libraries(arrow-dataset-file-benchmark PUBLIC arrow_dataset_shared)
target_link_libraries(arrow-dataset-scanner-benchmark PUBLIC arrow_dataset_shared)
endif()
endif()