Skip to content

Commit 5183981

Browse files
committed
simplify vendored lib
1 parent 2866d6e commit 5183981

File tree

3 files changed

+4
-53
lines changed

3 files changed

+4
-53
lines changed

cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
# Accumulate all dependencies to provide suitable static link parameters to the
1919
# third party libraries.
2020
set(ICEBERG_SYSTEM_DEPENDENCIES)
21-
set(ICEBERG_VENDOR_DEPENDENCIES)
2221
set(ICEBERG_ARROW_INSTALL_INTERFACE_LIBS)
2322

2423
# ----------------------------------------------------------------------
@@ -109,24 +108,17 @@ function(resolve_arrow_dependency)
109108
endif()
110109

111110
set(ARROW_VENDORED TRUE)
111+
set_target_properties(arrow_static PROPERTIES OUTPUT_NAME "iceberg_vendored_arrow")
112112
install(TARGETS arrow_static
113+
EXPORT iceberg_targets
113114
RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}"
114115
ARCHIVE DESTINATION "${ICEBERG_INSTALL_LIBDIR}"
115116
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
116-
117-
get_target_property(ARROW_STATIC_LIB arrow_static OUTPUT_NAME)
118-
set(ARROW_STATIC_LIB_NAME
119-
"${CMAKE_STATIC_LIBRARY_PREFIX}${ARROW_STATIC_LIB}${CMAKE_STATIC_LIBRARY_SUFFIX}")
120-
list(APPEND ICEBERG_VENDOR_DEPENDENCIES
121-
"Iceberg::arrow_vendored|${ARROW_STATIC_LIB_NAME}")
122117
else()
123118
set(ARROW_VENDORED FALSE)
124119
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES Arrow)
125120
endif()
126121

127-
set(ICEBERG_VENDOR_DEPENDENCIES
128-
${ICEBERG_VENDOR_DEPENDENCIES}
129-
PARENT_SCOPE)
130122
set(ICEBERG_SYSTEM_DEPENDENCIES
131123
${ICEBERG_SYSTEM_DEPENDENCIES}
132124
PARENT_SCOPE)

src/arrow/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ list(APPEND ICEBERG_ARROW_SHARED_BUILD_INTERFACE_LIBS
3434
"$<IF:$<TARGET_EXISTS:Arrow::arrow_shared>,Arrow::arrow_shared,Arrow::arrow_static>")
3535

3636
if(ARROW_VENDORED)
37-
list(APPEND ICEBERG_ARROW_STATIC_INSTALL_INTERFACE_LIBS Iceberg::arrow_vendored)
38-
list(APPEND ICEBERG_ARROW_SHARED_INSTALL_INTERFACE_LIBS Iceberg::arrow_vendored)
37+
list(APPEND ICEBERG_ARROW_STATIC_INSTALL_INTERFACE_LIBS Iceberg::arrow_static)
38+
list(APPEND ICEBERG_ARROW_SHARED_INSTALL_INTERFACE_LIBS Iceberg::arrow_static)
3939
else()
4040
list(APPEND
4141
ICEBERG_ARROW_STATIC_INSTALL_INTERFACE_LIBS

src/config.cmake.in

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
@PACKAGE_INIT@
3333

3434
set(ICEBERG_BUILD_STATIC "@ICEBERG_BUILD_STATIC@")
35-
set(ICEBERG_VENDOR_DEPENDENCIES "@ICEBERG_VENDOR_DEPENDENCIES@")
3635
set(ICEBERG_SYSTEM_DEPENDENCIES "@ICEBERG_SYSTEM_DEPENDENCIES@")
3736

3837
include(CMakeFindDependencyMacro)
@@ -70,41 +69,6 @@ macro(iceberg_find_components components)
7069
endforeach()
7170
endmacro()
7271

73-
macro(iceberg_find_vendor_dependencies dependencies)
74-
get_target_property(_iceberg_static_configurations
75-
Iceberg::iceberg_core_static IMPORTED_CONFIGURATIONS)
76-
77-
foreach(dependency ${dependencies})
78-
string(REPLACE "|" ";" _dependency_pair ${dependency})
79-
list(LENGTH _dependency_pair _dependency_pair_length)
80-
if(NOT _dependency_pair_length EQUAL 2)
81-
message(FATAL_ERROR "Invalid vendor dependency: ${dependency}")
82-
endif()
83-
list(GET _dependency_pair 0 _target_name)
84-
list(GET _dependency_pair 1 _static_lib_name)
85-
86-
add_library("${_target_name}" STATIC IMPORTED)
87-
88-
foreach(configuration ${_iceberg_static_configurations})
89-
string(TOUPPER "${configuration}" _configuration_upper_case)
90-
get_target_property(
91-
_iceberg_core_static_location
92-
Iceberg::iceberg_core_static LOCATION_${_configuration_upper_case})
93-
get_filename_component(
94-
iceberg_core_lib_dir
95-
"${_iceberg_core_static_location}" DIRECTORY)
96-
set_property(
97-
TARGET "${_target_name}"
98-
APPEND
99-
PROPERTY IMPORTED_CONFIGURATIONS ${_configuration_upper_case})
100-
set_target_properties(
101-
"${_target_name}"
102-
PROPERTIES IMPORTED_LOCATION_${_configuration_upper_case}
103-
"${iceberg_core_lib_dir}/${_static_lib_name}")
104-
endforeach()
105-
endforeach()
106-
endmacro()
107-
10872
include("${CMAKE_CURRENT_LIST_DIR}/iceberg-targets.cmake")
10973

11074
# Find required components
@@ -113,9 +77,4 @@ iceberg_find_components("${Iceberg_FIND_COMPONENTS}")
11377
# Find system dependencies
11478
iceberg_find_dependencies("${ICEBERG_SYSTEM_DEPENDENCIES}")
11579

116-
# Find vendor dependencies
117-
if(ICEBERG_BUILD_STATIC)
118-
iceberg_find_vendor_dependencies("${ICEBERG_VENDOR_DEPENDENCIES}")
119-
endif()
120-
12180
check_required_components(Iceberg)

0 commit comments

Comments
 (0)