File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,12 +55,19 @@ function(add_paimon_lib LIB_NAME)
5555 # Necessary to make static linking into other shared libraries work properly
5656 set_property (TARGET ${LIB_NAME} _objlib PROPERTY POSITION_INDEPENDENT_CODE 1)
5757 if (ARG_DEPENDENCIES)
58- # Avoid add_dependencies on non-existent targets (e.g. when building static only).
58+ # In static-only builds, some dependency names are still declared as
59+ # *_shared. Map them to *_static when the shared target is unavailable.
5960 set (_paimon_objlib_deps)
6061 foreach (_paimon_dep IN LISTS ARG_DEPENDENCIES)
61- if (TARGET ${_paimon_dep} )
62- list (APPEND _paimon_objlib_deps ${_paimon_dep} )
62+ set (_paimon_mapped_dep "${_paimon_dep} " )
63+ if (NOT TARGET ${_paimon_mapped_dep} AND _paimon_dep MATCHES "_shared$" )
64+ string (REGEX REPLACE "_shared$" "_static" _paimon_mapped_dep
65+ "${_paimon_dep} " )
6366 endif ()
67+ if (TARGET ${_paimon_mapped_dep} )
68+ list (APPEND _paimon_objlib_deps ${_paimon_mapped_dep} )
69+ endif ()
70+ unset (_paimon_mapped_dep)
6471 endforeach ()
6572 if (_paimon_objlib_deps)
6673 add_dependencies (${LIB_NAME} _objlib ${_paimon_objlib_deps} )
You can’t perform that action at this time.
0 commit comments