Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(c): Add BigQuery library to Meson build system #1994

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions c/driver/bigquery/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.


golang = find_program('go')

if build_machine.system() == 'windows'
prefix = ''
suffix = '.lib'
elif build_machine.system() == 'darwin'
prefix = 'lib'
suffix = '.dylib'
else
prefix = 'lib'
suffix = '.so'
endif

adbc_driver_bigquery_name = prefix + 'adbc_driver_bigquery' + suffix
adbc_driver_bigquery_lib = custom_target(
'adbc_driver_bigquery',
output: adbc_driver_bigquery_name,
command : [
golang,
'build',
'-C',
meson.project_source_root() + '/../go/adbc/pkg/bigquery',
'-tags=driverlib',
'-buildmode=c-shared',
'-o',
meson.current_build_dir() + '/' + adbc_driver_bigquery_name,
],
install : true,
install_dir : '.',
)

pkg.generate(
name: 'Apache Arrow Database Connectivity (ADBC) BigQuery driver',
description: 'The ADBC BigQuery driver provides an ADBC driver for BigQuery.',
libraries: [adbc_driver_bigquery_lib],
url: 'https://github.com/apache/arrow-adbc',
filebase: 'adbc-driver-bigquery',
)

if get_option('tests')
exc = executable(
'adbc-driver-bigquery-test',
'bigquery_test.cc',
include_directories: [root_dir, driver_dir],
link_with: [
adbc_common_lib,
adbc_driver_bigquery_lib
],
dependencies: [adbc_validation_dep],
)
test('adbc-driver-bigquery', exc)
endif
4 changes: 4 additions & 0 deletions c/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ if get_option('tests')
subdir('validation')
endif

if get_option('bigquery')
subdir('driver/bigquery')
endif

if get_option('flightsql')
subdir('driver/flightsql')
endif
Expand Down
6 changes: 6 additions & 0 deletions c/meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@

option('tests', type: 'boolean', description: 'Build tests', value: false)
option('benchmarks', type: 'boolean', description: 'Build benchmarks', value: false)
option(
'bigquery',
type: 'boolean',
description: 'Build ADBC BigQuery driver',
value: false
)
option(
'flightsql',
type: 'boolean',
Expand Down
Loading