Skip to content

Commit d7fdf2d

Browse files
author
nullccxsy
committed
refactor: enhance nanoarrow dependency handling in IcebergThirdpartyToolchain.cmake
- Added checks for the existence of the `nanoarrow_static` target before setting properties and installing it. - Introduced an alias for `nanoarrow::nanoarrow_static` if the target is not found, improving flexibility in dependency management. - Minor formatting adjustments for consistency in property settings for `nlohmann_json`.
1 parent fcfa820 commit d7fdf2d

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

cmake_modules/IcebergThirdpartyToolchain.cmake

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,17 +254,23 @@ function(resolve_nanoarrow_dependency)
254254
endif()
255255

256256
set(NANOARROW_VENDORED TRUE)
257-
set_target_properties(nanoarrow_static
258-
PROPERTIES OUTPUT_NAME "iceberg_vendored_nanoarrow"
259-
POSITION_INDEPENDENT_CODE ON)
260-
install(TARGETS nanoarrow_static
261-
EXPORT iceberg_targets
262-
RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}"
263-
ARCHIVE DESTINATION "${ICEBERG_INSTALL_LIBDIR}"
264-
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
257+
if(TARGET nanoarrow_static)
258+
set_target_properties(nanoarrow_static
259+
PROPERTIES OUTPUT_NAME "iceberg_vendored_nanoarrow"
260+
POSITION_INDEPENDENT_CODE ON)
261+
install(TARGETS nanoarrow_static
262+
EXPORT iceberg_targets
263+
RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}"
264+
ARCHIVE DESTINATION "${ICEBERG_INSTALL_LIBDIR}"
265+
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
266+
endif()
265267
else()
266268
set(NANOARROW_VENDORED FALSE)
267269
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES nanoarrow)
270+
271+
if(TARGET nanoarrow::nanoarrow AND NOT TARGET nanoarrow::nanoarrow_static)
272+
add_library(nanoarrow::nanoarrow_static ALIAS nanoarrow::nanoarrow)
273+
endif()
268274
endif()
269275

270276
set(ICEBERG_SYSTEM_DEPENDENCIES

0 commit comments

Comments
 (0)