Skip to content

Commit 9306a11

Browse files
authored
GH-47543: [C++] Search for system install of Azure libraries with Meson (#47544)
### Rationale for this change The current Meson configuration always builds Azure as a subproject. However, if it is available on the system, we can cut down on build time by adding some extra logic. ### What changes are included in this PR? Updates to the Meson configuration to search for azure libraries on the system ### Are these changes tested? Yes ### Are there any user-facing changes? No * GitHub Issue: #47543 Authored-by: Will Ayd <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent 417df28 commit 9306a11

File tree

1 file changed

+73
-22
lines changed

1 file changed

+73
-22
lines changed

cpp/src/arrow/meson.build

Lines changed: 73 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -327,30 +327,81 @@ if needs_filesystem
327327

328328
if needs_azure
329329
arrow_filesystem_srcs += ['filesystem/azurefs.cc']
330-
cmake = import('cmake')
331-
azure_opt = cmake.subproject_options()
332-
azure_opt.add_cmake_defines(
333-
{'BUILD_PERFORMANCE_TESTS': 'FALSE'},
334-
{'BUILD_SAMPLES': 'FALSE'},
335-
{'BUILD_TESTING': 'FALSE'},
336-
{'BUILD_WINDOWS_UWP': 'TRUE'},
337-
{'CMAKE_UNITY_BUILD': 'FALSE'},
338-
{'DISABLE_AZURE_CORE_OPENTELEMETRY': 'TRUE'},
339-
{'ENV{AZURE_SDK_DISABLE_AUTO_VCPKG}': 'TRUE'},
340-
{'WARNINGS_AS_ERRORS': 'FALSE'},
330+
331+
azure_core_dep = dependency(
332+
'azure-core-cpp',
333+
allow_fallback: false,
334+
modules: ['Azure::azure-core'],
335+
required: false,
341336
)
342-
azure_opt.append_compile_args('cpp', '-fPIC')
343-
azure_proj = cmake.subproject('azure', options: azure_opt)
344-
345-
azure_dep = declare_dependency(
346-
dependencies: [
347-
azure_proj.dependency('azure-core'),
348-
azure_proj.dependency('azure-identity'),
349-
azure_proj.dependency('azure-storage-blobs'),
350-
azure_proj.dependency('azure-storage-common'),
351-
azure_proj.dependency('azure-storage-files-datalake'),
352-
],
337+
azure_identity_dep = dependency(
338+
'azure-identity-cpp',
339+
allow_fallback: false,
340+
modules: ['Azure::azure-identity'],
341+
required: false,
342+
)
343+
azure_storage_blobs_dep = dependency(
344+
'azure-storage-blobs-cpp',
345+
allow_fallback: false,
346+
modules: ['Azure::azure-storage-blobs'],
347+
required: false,
348+
)
349+
azure_storage_common_dep = dependency(
350+
'azure-storage-common-cpp',
351+
allow_fallback: false,
352+
modules: ['Azure::azure-storage-common'],
353+
required: false,
353354
)
355+
azure_storage_files_datalake_dep = dependency(
356+
'azure-storage-files-datalake-cpp',
357+
allow_fallback: false,
358+
modules: ['Azure::azure-storage-files-datalake'],
359+
required: false,
360+
)
361+
362+
if (
363+
azure_core_dep.found()
364+
and azure_identity_dep.found()
365+
and azure_storage_blobs_dep.found()
366+
and azure_storage_common_dep.found()
367+
and azure_storage_files_datalake_dep.found()
368+
)
369+
azure_dep = declare_dependency(
370+
dependencies: [
371+
azure_core_dep,
372+
azure_identity_dep,
373+
azure_storage_blobs_dep,
374+
azure_storage_common_dep,
375+
azure_storage_files_datalake_dep,
376+
],
377+
)
378+
else
379+
cmake = import('cmake')
380+
azure_opt = cmake.subproject_options()
381+
azure_opt.add_cmake_defines(
382+
{'BUILD_PERFORMANCE_TESTS': 'FALSE'},
383+
{'BUILD_SAMPLES': 'FALSE'},
384+
{'BUILD_TESTING': 'FALSE'},
385+
{'BUILD_WINDOWS_UWP': 'TRUE'},
386+
{'CMAKE_UNITY_BUILD': 'FALSE'},
387+
{'DISABLE_AZURE_CORE_OPENTELEMETRY': 'TRUE'},
388+
{'ENV{AZURE_SDK_DISABLE_AUTO_VCPKG}': 'TRUE'},
389+
{'WARNINGS_AS_ERRORS': 'FALSE'},
390+
)
391+
azure_opt.append_compile_args('cpp', '-fPIC')
392+
azure_proj = cmake.subproject('azure', options: azure_opt)
393+
394+
azure_dep = declare_dependency(
395+
dependencies: [
396+
azure_proj.dependency('azure-core'),
397+
azure_proj.dependency('azure-identity'),
398+
azure_proj.dependency('azure-storage-blobs'),
399+
azure_proj.dependency('azure-storage-common'),
400+
azure_proj.dependency('azure-storage-files-datalake'),
401+
],
402+
)
403+
endif
404+
354405
arrow_filesystem_deps += [azure_dep]
355406
endif
356407

0 commit comments

Comments
 (0)