Skip to content

Commit 3f198e4

Browse files
committed
fix: build unit tests with shared library
1 parent 883a43f commit 3f198e4

27 files changed

+368
-170
lines changed

CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,25 @@ option(ICEBERG_BUILD_REST_INTEGRATION_TESTS "Build rest catalog integration test
4646
option(ICEBERG_ENABLE_ASAN "Enable Address Sanitizer" OFF)
4747
option(ICEBERG_ENABLE_UBSAN "Enable Undefined Behavior Sanitizer" OFF)
4848

49+
if(ICEBERG_BUILD_SHARED)
50+
set(ICEBERG_TEST_LINKAGE_DEFAULT "shared")
51+
else()
52+
set(ICEBERG_TEST_LINKAGE_DEFAULT "static")
53+
endif()
54+
set(ICEBERG_TEST_LINKAGE
55+
${ICEBERG_TEST_LINKAGE_DEFAULT}
56+
CACHE STRING "Linkage of Iceberg libraries with unit tests executables")
57+
if(ICEBERG_BUILD_TESTS)
58+
if(ICEBERG_TEST_LINKAGE STREQUAL "shared" AND NOT ICEBERG_BUILD_SHARED)
59+
message(FATAL_ERROR "If using ICEBERG_TEST_LINKAGE=shared, must also pass ICEBERG_BUILD_SHARED=ON"
60+
)
61+
endif()
62+
if(ICEBERG_TEST_LINKAGE STREQUAL "static" AND NOT ICEBERG_BUILD_STATIC)
63+
message(FATAL_ERROR "If using ICEBERG_TEST_LINKAGE=static, must also pass ICEBERG_BUILD_STATIC=ON"
64+
)
65+
endif()
66+
endif()
67+
4968
include(GNUInstallDirs)
5069
include(FetchContent)
5170

cmake_modules/IcebergThirdpartyToolchain.cmake

Lines changed: 108 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ endmacro()
8282
function(resolve_arrow_dependency)
8383
prepare_fetchcontent()
8484

85-
set(ARROW_BUILD_SHARED OFF)
86-
set(ARROW_BUILD_STATIC ON)
85+
set(ARROW_BUILD_SHARED ${ICEBERG_BUILD_SHARED})
86+
set(ARROW_BUILD_STATIC ${ICEBERG_BUILD_STATIC})
8787
# Work around undefined symbol: arrow::ipc::ReadSchema(arrow::io::InputStream*, arrow::ipc::DictionaryMemo*)
8888
set(ARROW_IPC ON)
8989
set(ARROW_FILESYSTEM ON)
@@ -112,43 +112,74 @@ function(resolve_arrow_dependency)
112112
fetchcontent_makeavailable(VendoredArrow)
113113

114114
if(vendoredarrow_SOURCE_DIR)
115-
if(NOT TARGET Arrow::arrow_static)
116-
add_library(Arrow::arrow_static INTERFACE IMPORTED)
117-
target_link_libraries(Arrow::arrow_static INTERFACE arrow_static)
118-
target_include_directories(Arrow::arrow_static
119-
INTERFACE ${vendoredarrow_BINARY_DIR}/src
120-
${vendoredarrow_SOURCE_DIR}/cpp/src)
115+
if(ARROW_BUILD_STATIC)
116+
if(NOT TARGET Arrow::arrow_static)
117+
add_library(Arrow::arrow_static INTERFACE IMPORTED)
118+
target_link_libraries(Arrow::arrow_static INTERFACE arrow_static)
119+
target_include_directories(Arrow::arrow_static
120+
INTERFACE ${vendoredarrow_BINARY_DIR}/src
121+
${vendoredarrow_SOURCE_DIR}/cpp/src)
122+
endif()
123+
124+
if(NOT TARGET Parquet::parquet_static)
125+
add_library(Parquet::parquet_static INTERFACE IMPORTED)
126+
target_link_libraries(Parquet::parquet_static INTERFACE parquet_static)
127+
target_include_directories(Parquet::parquet_static
128+
INTERFACE ${vendoredarrow_BINARY_DIR}/src
129+
${vendoredarrow_SOURCE_DIR}/cpp/src)
130+
endif()
131+
132+
set_target_properties(arrow_static PROPERTIES OUTPUT_NAME
133+
"iceberg_vendored_arrow_static")
134+
set_target_properties(parquet_static PROPERTIES OUTPUT_NAME
135+
"iceberg_vendored_parquet_static")
136+
install(TARGETS arrow_static parquet_static
137+
EXPORT iceberg_targets
138+
RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}"
139+
ARCHIVE DESTINATION "${ICEBERG_INSTALL_LIBDIR}"
140+
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
141+
142+
if(TARGET arrow_bundled_dependencies)
143+
message(STATUS "arrow_bundled_dependencies found")
144+
# arrow_bundled_dependencies is only INSTALL_INTERFACE and will not be built by default.
145+
# We need to add it as a dependency to arrow_static so that it will be built.
146+
add_dependencies(arrow_static arrow_bundled_dependencies)
147+
# We cannot install an IMPORTED target, so we need to install the library manually.
148+
get_target_property(arrow_bundled_dependencies_location
149+
arrow_bundled_dependencies IMPORTED_LOCATION)
150+
install(FILES ${arrow_bundled_dependencies_location}
151+
DESTINATION ${ICEBERG_INSTALL_LIBDIR})
152+
endif()
121153
endif()
122154

123-
if(NOT TARGET Parquet::parquet_static)
124-
add_library(Parquet::parquet_static INTERFACE IMPORTED)
125-
target_link_libraries(Parquet::parquet_static INTERFACE parquet_static)
126-
target_include_directories(Parquet::parquet_static
127-
INTERFACE ${vendoredarrow_BINARY_DIR}/src
128-
${vendoredarrow_SOURCE_DIR}/cpp/src)
155+
if(ARROW_BUILD_SHARED)
156+
if(NOT TARGET Arrow::arrow_shared)
157+
add_library(Arrow::arrow_shared INTERFACE IMPORTED)
158+
target_link_libraries(Arrow::arrow_shared INTERFACE arrow_shared)
159+
target_include_directories(Arrow::arrow_shared
160+
INTERFACE ${vendoredarrow_BINARY_DIR}/src
161+
${vendoredarrow_SOURCE_DIR}/cpp/src)
162+
endif()
163+
164+
if(NOT TARGET Parquet::parquet_shared)
165+
add_library(Parquet::parquet_shared INTERFACE IMPORTED)
166+
target_link_libraries(Parquet::parquet_shared INTERFACE parquet_shared)
167+
target_include_directories(Parquet::parquet_shared
168+
INTERFACE ${vendoredarrow_BINARY_DIR}/src
169+
${vendoredarrow_SOURCE_DIR}/cpp/src)
170+
endif()
171+
172+
set_target_properties(arrow_shared PROPERTIES OUTPUT_NAME "iceberg_vendored_arrow")
173+
set_target_properties(parquet_shared PROPERTIES OUTPUT_NAME
174+
"iceberg_vendored_parquet")
175+
install(TARGETS arrow_shared parquet_shared
176+
EXPORT iceberg_targets
177+
RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}"
178+
ARCHIVE DESTINATION "${ICEBERG_INSTALL_LIBDIR}"
179+
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
129180
endif()
130181

131182
set(ARROW_VENDORED TRUE)
132-
set_target_properties(arrow_static PROPERTIES OUTPUT_NAME "iceberg_vendored_arrow")
133-
set_target_properties(parquet_static PROPERTIES OUTPUT_NAME
134-
"iceberg_vendored_parquet")
135-
install(TARGETS arrow_static parquet_static
136-
EXPORT iceberg_targets
137-
RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}"
138-
ARCHIVE DESTINATION "${ICEBERG_INSTALL_LIBDIR}"
139-
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
140-
141-
if(TARGET arrow_bundled_dependencies)
142-
message(STATUS "arrow_bundled_dependencies found")
143-
# arrow_bundled_dependencies is only INSTALL_INTERFACE and will not be built by default.
144-
# We need to add it as a dependency to arrow_static so that it will be built.
145-
add_dependencies(arrow_static arrow_bundled_dependencies)
146-
# We cannot install an IMPORTED target, so we need to install the library manually.
147-
get_target_property(arrow_bundled_dependencies_location arrow_bundled_dependencies
148-
IMPORTED_LOCATION)
149-
install(FILES ${arrow_bundled_dependencies_location}
150-
DESTINATION ${ICEBERG_INSTALL_LIBDIR})
151-
endif()
152183
else()
153184
set(ARROW_VENDORED FALSE)
154185
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES Arrow)
@@ -167,6 +198,8 @@ endfunction()
167198

168199
function(resolve_avro_dependency)
169200
prepare_fetchcontent()
201+
set(BUILD_SHARED_LIBS ${ICEBERG_BUILD_SHARED})
202+
set(BUILD_STATIC_LIBS ${ICEBERG_BUILD_STATIC})
170203

171204
set(AVRO_USE_BOOST
172205
OFF
@@ -212,28 +245,50 @@ function(resolve_avro_dependency)
212245
fetchcontent_makeavailable(avro-cpp)
213246

214247
if(avro-cpp_SOURCE_DIR)
215-
if(NOT TARGET avro-cpp::avrocpp_static)
216-
add_library(avro-cpp::avrocpp_static INTERFACE IMPORTED)
217-
target_link_libraries(avro-cpp::avrocpp_static INTERFACE avrocpp_s)
218-
target_include_directories(avro-cpp::avrocpp_static
219-
INTERFACE ${avro-cpp_BINARY_DIR}
220-
${avro-cpp_SOURCE_DIR}/lang/c++)
248+
if(BUILD_STATIC_LIBS)
249+
if(NOT TARGET avro-cpp::avrocpp_static)
250+
add_library(avro-cpp::avrocpp_static INTERFACE IMPORTED)
251+
target_link_libraries(avro-cpp::avrocpp_static INTERFACE avrocpp_s)
252+
target_include_directories(avro-cpp::avrocpp_static
253+
INTERFACE ${avro-cpp_BINARY_DIR}
254+
${avro-cpp_SOURCE_DIR}/lang/c++)
255+
endif()
256+
257+
set_target_properties(avrocpp_s PROPERTIES OUTPUT_NAME
258+
"iceberg_vendored_avrocpp_static")
259+
set_target_properties(avrocpp_s PROPERTIES POSITION_INDEPENDENT_CODE ON)
260+
install(TARGETS avrocpp_s
261+
EXPORT iceberg_targets
262+
RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}"
263+
ARCHIVE DESTINATION "${ICEBERG_INSTALL_LIBDIR}"
264+
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
265+
266+
# TODO: add vendored ZLIB and Snappy support
267+
find_package(Snappy CONFIG)
268+
if(Snappy_FOUND)
269+
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES Snappy)
270+
endif()
221271
endif()
222272

223-
set(AVRO_VENDORED TRUE)
224-
set_target_properties(avrocpp_s PROPERTIES OUTPUT_NAME "iceberg_vendored_avrocpp")
225-
set_target_properties(avrocpp_s PROPERTIES POSITION_INDEPENDENT_CODE ON)
226-
install(TARGETS avrocpp_s
227-
EXPORT iceberg_targets
228-
RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}"
229-
ARCHIVE DESTINATION "${ICEBERG_INSTALL_LIBDIR}"
230-
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
231-
232-
# TODO: add vendored ZLIB and Snappy support
233-
find_package(Snappy CONFIG)
234-
if(Snappy_FOUND)
235-
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES Snappy)
273+
if(BUILD_SHARED_LIBS)
274+
if(NOT TARGET avro-cpp::avrocpp_shared)
275+
add_library(avro-cpp::avrocpp_shared INTERFACE IMPORTED)
276+
target_link_libraries(avro-cpp::avrocpp_shared INTERFACE avrocpp)
277+
target_include_directories(avro-cpp::avrocpp_shared
278+
INTERFACE ${avro-cpp_BINARY_DIR}
279+
${avro-cpp_SOURCE_DIR}/lang/c++)
280+
endif()
281+
282+
set_target_properties(avrocpp PROPERTIES OUTPUT_NAME "iceberg_vendored_avrocpp")
283+
set_target_properties(avrocpp PROPERTIES POSITION_INDEPENDENT_CODE ON)
284+
install(TARGETS avrocpp
285+
EXPORT iceberg_targets
286+
RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}"
287+
ARCHIVE DESTINATION "${ICEBERG_INSTALL_LIBDIR}"
288+
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
236289
endif()
290+
291+
set(AVRO_VENDORED TRUE)
237292
else()
238293
set(AVRO_VENDORED FALSE)
239294
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES Avro)

src/iceberg/CMakeLists.txt

Lines changed: 27 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -115,31 +115,28 @@ set(ICEBERG_SOURCES
115115

116116
set(ICEBERG_STATIC_BUILD_INTERFACE_LIBS)
117117
set(ICEBERG_SHARED_BUILD_INTERFACE_LIBS)
118+
set(ICEBERG_SHARED_PRIVATE_BUILD_INTERFACE_LIBS)
118119
set(ICEBERG_STATIC_INSTALL_INTERFACE_LIBS)
119120
set(ICEBERG_SHARED_INSTALL_INTERFACE_LIBS)
120121

121122
list(APPEND
122123
ICEBERG_STATIC_BUILD_INTERFACE_LIBS
123-
nanoarrow::nanoarrow_static
124+
nanoarrow::nanoarrow
124125
nlohmann_json::nlohmann_json
125126
roaring::roaring
126127
ZLIB::ZLIB)
127128
list(APPEND
128-
ICEBERG_SHARED_BUILD_INTERFACE_LIBS
129-
nanoarrow::nanoarrow_shared
129+
ICEBERG_SHARED_PRIVATE_BUILD_INTERFACE_LIBS
130+
nanoarrow::nanoarrow
130131
nlohmann_json::nlohmann_json
131132
roaring::roaring
132133
ZLIB::ZLIB)
133134
list(APPEND
134135
ICEBERG_STATIC_INSTALL_INTERFACE_LIBS
135-
"$<IF:$<BOOL:${NANOARROW_VENDORED}>,iceberg::nanoarrow_static,$<IF:$<TARGET_EXISTS:nanoarrow::nanoarrow_static>,nanoarrow::nanoarrow_static,nanoarrow::nanoarrow_shared>>"
136-
"$<IF:$<BOOL:${NLOHMANN_JSON_VENDORED}>,iceberg::nlohmann_json,$<IF:$<TARGET_EXISTS:nlohmann_json::nlohmann_json>,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>"
137-
"$<IF:$<BOOL:${CROARING_VENDORED}>,iceberg::roaring,roaring::roaring>")
138-
list(APPEND
139-
ICEBERG_SHARED_INSTALL_INTERFACE_LIBS
140-
"$<IF:$<BOOL:${NANOARROW_VENDORED}>,iceberg::nanoarrow_shared,$<IF:$<TARGET_EXISTS:nanoarrow::nanoarrow_shared>,nanoarrow::nanoarrow_shared,nanoarrow::nanoarrow_static>>"
141-
"$<IF:$<BOOL:${NLOHMANN_JSON_VENDORED}>,iceberg::nlohmann_json,$<IF:$<TARGET_EXISTS:nlohmann_json::nlohmann_json>,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>"
142-
"$<IF:$<BOOL:${CROARING_VENDORED}>,iceberg::roaring,roaring::roaring>")
136+
"$<IF:$<BOOL:${NANOARROW_VENDORED}>,iceberg::nanoarrow_static,nanoarrow::nanoarrow>"
137+
"$<IF:$<BOOL:${NLOHMANN_JSON_VENDORED}>,iceberg::nlohmann_json,nlohmann_json::nlohmann_json>"
138+
"$<IF:$<BOOL:${CROARING_VENDORED}>,iceberg::roaring,roaring::roaring>"
139+
ZLIB::ZLIB)
143140

144141
add_iceberg_lib(iceberg
145142
SOURCES
@@ -148,6 +145,8 @@ add_iceberg_lib(iceberg
148145
${ICEBERG_INCLUDES}
149146
SHARED_LINK_LIBS
150147
${ICEBERG_SHARED_BUILD_INTERFACE_LIBS}
148+
SHARED_PRIVATE_LINK_LIBS
149+
${ICEBERG_SHARED_PRIVATE_BUILD_INTERFACE_LIBS}
151150
STATIC_LINK_LIBS
152151
${ICEBERG_STATIC_BUILD_INTERFACE_LIBS}
153152
STATIC_INSTALL_INTERFACE_LIBS
@@ -188,44 +187,38 @@ if(ICEBERG_BUILD_BUNDLE)
188187
# Libraries to link with exported libiceberg_bundle.{so,a}.
189188
set(ICEBERG_BUNDLE_STATIC_BUILD_INTERFACE_LIBS)
190189
set(ICEBERG_BUNDLE_SHARED_BUILD_INTERFACE_LIBS)
190+
set(ICEBERG_BUNDLE_SHARED_PRIVATE_BUILD_INTERFACE_LIBS)
191191
set(ICEBERG_BUNDLE_STATIC_INSTALL_INTERFACE_LIBS)
192192
set(ICEBERG_BUNDLE_SHARED_INSTALL_INTERFACE_LIBS)
193193

194194
list(APPEND
195195
ICEBERG_BUNDLE_STATIC_BUILD_INTERFACE_LIBS
196-
"$<IF:$<TARGET_EXISTS:iceberg_static>,iceberg_static,iceberg_shared>"
197-
"$<IF:$<TARGET_EXISTS:Arrow::arrow_static>,Arrow::arrow_static,Arrow::arrow_shared>"
198-
"$<IF:$<TARGET_EXISTS:Parquet::parquet_static>,Parquet::parquet_static,Parquet::parquet_shared>"
199-
"$<IF:$<TARGET_EXISTS:avro-cpp::avrocpp_static>,avro-cpp::avrocpp_static,avro-cpp::avrocpp_shared>"
200-
)
196+
iceberg_static
197+
Arrow::arrow_static
198+
Parquet::parquet_static
199+
avro-cpp::avrocpp_static)
201200
list(APPEND
202201
ICEBERG_BUNDLE_SHARED_BUILD_INTERFACE_LIBS
203-
"$<IF:$<TARGET_EXISTS:iceberg_shared>,iceberg_shared,iceberg_static>"
204-
"$<IF:$<TARGET_EXISTS:Arrow::arrow_shared>,Arrow::arrow_shared,Arrow::arrow_static>"
205-
"$<IF:$<TARGET_EXISTS:Parquet::parquet_shared>,Parquet::parquet_shared,Parquet::parquet_static>"
206-
"$<IF:$<TARGET_EXISTS:avro-cpp::avrocpp_shared>,avro-cpp::avrocpp_shared,avro-cpp::avrocpp_static>"
207-
)
208-
202+
iceberg_shared
203+
Arrow::arrow_shared
204+
Parquet::parquet_shared
205+
avro-cpp::avrocpp_shared)
206+
list(APPEND ICEBERG_BUNDLE_SHARED_PRIVATE_BUILD_INTERFACE_LIBS nanoarrow::nanoarrow)
209207
list(APPEND
210208
ICEBERG_BUNDLE_STATIC_INSTALL_INTERFACE_LIBS
211-
"$<IF:$<TARGET_EXISTS:iceberg::iceberg_static>,iceberg::iceberg_static,iceberg::iceberg_shared>"
212-
"$<IF:$<BOOL:${ARROW_VENDORED}>,iceberg::arrow_static,$<IF:$<TARGET_EXISTS:Arrow::arrow_static>,Arrow::arrow_static,Arrow::arrow_shared>>"
213-
"$<IF:$<BOOL:${ARROW_VENDORED}>,iceberg::parquet_static,$<IF:$<TARGET_EXISTS:Parquet::parquet_static>,Parquet::parquet_static,Parquet::parquet_shared>>"
214-
"$<IF:$<BOOL:${AVRO_VENDORED}>,iceberg::avrocpp_s,$<IF:$<TARGET_EXISTS:avro-cpp::avrocpp_static>,avro-cpp::avrocpp_static,avro-cpp::avrocpp_shared>>"
215-
)
216-
list(APPEND
217-
ICEBERG_BUNDLE_SHARED_INSTALL_INTERFACE_LIBS
218-
"$<IF:$<TARGET_EXISTS:iceberg::iceberg_shared>,iceberg::iceberg_shared,iceberg::iceberg_static>"
219-
"$<IF:$<BOOL:${ARROW_VENDORED}>,iceberg::arrow_static,$<IF:$<TARGET_EXISTS:Arrow::arrow_shared>,Arrow::arrow_shared,Arrow::arrow_static>>"
220-
"$<IF:$<BOOL:${ARROW_VENDORED}>,iceberg::parquet_static,$<IF:$<TARGET_EXISTS:Parquet::parquet_shared>,Parquet::parquet_shared,Parquet::parquet_static>>"
221-
"$<IF:$<BOOL:${AVRO_VENDORED}>,iceberg::avrocpp_s,$<IF:$<TARGET_EXISTS:avro-cpp::avrocpp_shared>,avro-cpp::avrocpp_shared,avro-cpp::avrocpp_static>>"
222-
)
209+
iceberg::iceberg_static
210+
"$<IF:$<BOOL:${ARROW_VENDORED}>,iceberg::arrow_static,Arrow::arrow_static>"
211+
"$<IF:$<BOOL:${ARROW_VENDORED}>,iceberg::parquet_static,Parquet::parquet_static>"
212+
"$<IF:$<BOOL:${AVRO_VENDORED}>,iceberg::avrocpp_s,avro-cpp::avrocpp_static>")
213+
list(APPEND ICEBERG_BUNDLE_SHARED_INSTALL_INTERFACE_LIBS iceberg::iceberg_shared)
223214

224215
add_iceberg_lib(iceberg_bundle
225216
SOURCES
226217
${ICEBERG_BUNDLE_SOURCES}
227218
SHARED_LINK_LIBS
228219
${ICEBERG_BUNDLE_SHARED_BUILD_INTERFACE_LIBS}
220+
SHARED_PRIVATE_LINK_LIBS
221+
${ICEBERG_BUNDLE_SHARED_PRIVATE_BUILD_INTERFACE_LIBS}
229222
STATIC_LINK_LIBS
230223
${ICEBERG_BUNDLE_STATIC_BUILD_INTERFACE_LIBS}
231224
STATIC_INSTALL_INTERFACE_LIBS

src/iceberg/arrow_c_data_guard_internal.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
#include "iceberg/arrow_c_data_guard_internal.h"
2121

22+
#include <nanoarrow/nanoarrow.h>
23+
2224
namespace iceberg::internal {
2325

2426
ArrowArrayGuard::~ArrowArrayGuard() {

src/iceberg/arrow_c_data_guard_internal.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@
1919

2020
#pragma once
2121

22-
#include <nanoarrow/nanoarrow.h>
22+
#include "iceberg/iceberg_export.h"
2323

24-
#include "iceberg/arrow_c_data.h"
24+
struct ArrowArray;
25+
struct ArrowArrayView;
26+
struct ArrowBuffer;
27+
struct ArrowSchema;
2528

2629
namespace iceberg::internal {
2730

28-
class ArrowArrayGuard {
31+
class ICEBERG_EXPORT ArrowArrayGuard {
2932
public:
3033
explicit ArrowArrayGuard(ArrowArray* array) : array_(array) {}
3134
~ArrowArrayGuard();
@@ -34,7 +37,7 @@ class ArrowArrayGuard {
3437
ArrowArray* array_;
3538
};
3639

37-
class ArrowSchemaGuard {
40+
class ICEBERG_EXPORT ArrowSchemaGuard {
3841
public:
3942
explicit ArrowSchemaGuard(ArrowSchema* schema) : schema_(schema) {}
4043
~ArrowSchemaGuard();
@@ -43,7 +46,7 @@ class ArrowSchemaGuard {
4346
ArrowSchema* schema_;
4447
};
4548

46-
class ArrowArrayViewGuard {
49+
class ICEBERG_EXPORT ArrowArrayViewGuard {
4750
public:
4851
explicit ArrowArrayViewGuard(ArrowArrayView* view) : view_(view) {}
4952
~ArrowArrayViewGuard();
@@ -52,7 +55,7 @@ class ArrowArrayViewGuard {
5255
ArrowArrayView* view_;
5356
};
5457

55-
class ArrowArrayBufferGuard {
58+
class ICEBERG_EXPORT ArrowArrayBufferGuard {
5659
public:
5760
explicit ArrowArrayBufferGuard(ArrowBuffer* buffer) : buffer_(buffer) {}
5861
~ArrowArrayBufferGuard();

0 commit comments

Comments
 (0)