@@ -134,7 +134,6 @@ endif
134134if needs_flight
135135 arrow_flight_dep = dependency (' arrow-flight' )
136136 libpyarrow_deps += [arrow_flight_dep]
137- cython_modules += {' _flight' : {' dependencies' : arrow_flight_dep}}
138137endif
139138
140139if get_option (' gandiva' ).enabled()
@@ -186,28 +185,16 @@ if needs_parquet
186185 libpyarrow_deps += [parquet_dep]
187186 cython_modules += {' _parquet' : {' dependencies' : parquet_dep}}
188187
189- if needs_parquet_encryption
190- cython_modules += {' _parquet_encryption' : {' dependencies' : parquet_dep}}
191- endif
192-
193188 if needs_dataset
194189 cython_modules += {
195190 ' _dataset_parquet' : {
196191 ' dependencies' : [parquet_dep, arrow_dataset_dep],
197192 },
198193 }
199-
200- if needs_parquet_encryption
201- cython_modules += {
202- ' _dataset_parquet_encryption' : {
203- ' dependencies' : [parquet_dep, arrow_dataset_dep],
204- },
205- }
206- endif
207194 endif
208195endif
209196
210- arrow_python_lib = py.extension_module (
197+ arrow_python_lib = shared_library (
211198 ' arrow_python' ,
212199 sources : pyarrow_srcs,
213200 include_directories : [' src' ],
@@ -222,26 +209,34 @@ arrow_python_lib = py.extension_module(
222209 install : true ,
223210 install_dir : py.get_install_dir() / ' pyarrow' ,
224211 gnu_symbol_visibility : ' inlineshidden' ,
212+ override_options : [' b_lundef=false' ],
225213)
214+ pyarrow_lib_dep = declare_dependency (link_with : [arrow_python_lib])
226215
227216if needs_flight
228- flight_lib = py.extension_module (
217+ pyarrow_flight_lib = shared_library (
229218 ' arrow_flight_lib' ,
230219 sources : [' src/arrow/python/flight.cc' ],
231- link_with : [arrow_python_lib],
232- dependencies : [arrow_flight_dep, py.dependency ()],
220+ dependencies : [arrow_flight_dep, pyarrow_lib_dep, py.dependency ()],
233221 include_directories : [' src' ],
234222 cpp_args : cc.get_supported_arguments(
235223 [' -DARROW_PYFLIGHT_EXPORTING' , ' /DARROW_PYFLIGHT_EXPORTING' ],
236224 ),
237225 install : true ,
238226 install_dir : py.get_install_dir() / ' pyarrow' ,
239227 gnu_symbol_visibility : ' inlineshidden' ,
228+ override_options : [' b_lundef=false' ],
240229 )
230+
231+ pyarrow_flight_dep = declare_dependency (
232+ link_with : [pyarrow_flight_lib],
233+ dependencies : [arrow_flight_dep],
234+ )
235+ cython_modules += {' _flight' : {' dependencies' : [pyarrow_flight_dep]}}
241236endif
242237
243238if needs_parquet_encryption
244- arrow_encryption_lib = py.extension_module (
239+ pyarrow_encryption_lib = shared_library (
245240 ' arrow_python_parquet_encryption' ,
246241 sources : [' src/arrow/python/parquet_encryption.cc' ],
247242 include_directories : [' src' ],
@@ -256,7 +251,30 @@ if needs_parquet_encryption
256251 install : true ,
257252 install_dir : py.get_install_dir() / ' pyarrow' ,
258253 gnu_symbol_visibility : ' inlineshidden' ,
254+ override_options : [' b_lundef=false' ],
255+ )
256+
257+ pyarrow_parquet_encryption_dep = declare_dependency (
258+ link_with : [pyarrow_encryption_lib],
259+ dependencies : [parquet_dep],
259260 )
261+
262+ cython_modules += {
263+ ' _parquet_encryption' : {
264+ ' dependencies' : [pyarrow_parquet_encryption_dep],
265+ },
266+ }
267+
268+ if needs_dataset
269+ cython_modules += {
270+ ' _dataset_parquet_encryption' : {
271+ ' dependencies' : [
272+ arrow_dataset_dep,
273+ pyarrow_parquet_encryption_dep,
274+ ],
275+ },
276+ }
277+ endif
260278endif
261279
262280foreach key, val : cython_modules
0 commit comments