kou commented on code in PR #1904: URL: https://github.com/apache/arrow-adbc/pull/1904#discussion_r1632476450
########## c/driver/postgresql/meson.build: ########## @@ -0,0 +1,68 @@ +# 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. + +libpq_dep = dependency('libpq') + +adbc_postgres_driver_lib = library( + 'adbc_driver_postgresql', + sources: [ + 'connection.cc', + 'error.cc', + 'database.cc', + 'postgresql.cc', + 'result_helper.cc', + 'statement.cc', + ], + include_directories: [root_dir], + link_with: [adbc_common_lib, adbc_framework_lib], + dependencies: [nanoarrow_dep, fmt_dep, libpq_dep], +) + +if get_option('tests') + postgres_tests = { + 'driver-postgresql': { + 'src_name': 'driver_postgresql', + 'sources': [ + 'postgres_type_test.cc', + 'postgresql_test.cc', + ] + }, + 'driver-postgresql-copy': { + 'src_name': 'driver_postgresql_copy', + 'sources': [ + 'copy/postgres_copy_reader_test.cc', + 'copy/postgres_copy_writer_test.cc', + ] + }, + } + + foreach nm, conf : postgres_tests Review Comment: ```suggestion foreach name, conf : postgres_tests ``` ########## c/driver/postgresql/meson.build: ########## @@ -0,0 +1,68 @@ +# 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. + +libpq_dep = dependency('libpq') + +adbc_postgres_driver_lib = library( + 'adbc_driver_postgresql', + sources: [ + 'connection.cc', + 'error.cc', + 'database.cc', + 'postgresql.cc', + 'result_helper.cc', + 'statement.cc', + ], + include_directories: [root_dir], + link_with: [adbc_common_lib, adbc_framework_lib], + dependencies: [nanoarrow_dep, fmt_dep, libpq_dep], +) + +if get_option('tests') + postgres_tests = { + 'driver-postgresql': { + 'src_name': 'driver_postgresql', + 'sources': [ + 'postgres_type_test.cc', + 'postgresql_test.cc', + ] + }, + 'driver-postgresql-copy': { + 'src_name': 'driver_postgresql_copy', + 'sources': [ + 'copy/postgres_copy_reader_test.cc', + 'copy/postgres_copy_writer_test.cc', + ] + }, + } + + foreach nm, conf : postgres_tests + exc = executable( + 'adbc-' + nm + '-test', Review Comment: ```suggestion 'adbc-' + name + '-test', ``` ########## CONTRIBUTING.md: ########## @@ -148,6 +148,43 @@ for details. [cmake-prefix-path]: https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html [gtest]: https://github.com/google/googletest/ +### C/C++ with Meson + +While CMake is the officially supported build generator, there is limited, +experimental support for the Meson build system. Meson offers arguably better +dependency management than CMake, with a syntax that Python developers may +find more readable. + +To use Meson, start at the c directory and run: + +```shell +$ meson setup build +``` + +For a full list of options, ``meson configure`` will bring up a pager +with sections that you can navigate. The "Project Options" section in particular +will show you what ADBC has to offer, and each option can be provided using +the form ``-D_option_:_value_``. For example, to build the a debug version of +the SQLite3 driver along with tests, you would run: + +```shell Review Comment: ```suggestion ```console ``` ########## CONTRIBUTING.md: ########## @@ -148,6 +148,43 @@ for details. [cmake-prefix-path]: https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html [gtest]: https://github.com/google/googletest/ +### C/C++ with Meson + +While CMake is the officially supported build generator, there is limited, +experimental support for the Meson build system. Meson offers arguably better +dependency management than CMake, with a syntax that Python developers may +find more readable. + +To use Meson, start at the c directory and run: + +```shell Review Comment: ```suggestion ```console ``` ########## c/driver/postgresql/meson.build: ########## @@ -0,0 +1,68 @@ +# 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. + +libpq_dep = dependency('libpq') + +adbc_postgres_driver_lib = library( + 'adbc_driver_postgresql', + sources: [ + 'connection.cc', + 'error.cc', + 'database.cc', + 'postgresql.cc', + 'result_helper.cc', + 'statement.cc', + ], + include_directories: [root_dir], + link_with: [adbc_common_lib, adbc_framework_lib], + dependencies: [nanoarrow_dep, fmt_dep, libpq_dep], +) + +if get_option('tests') + postgres_tests = { + 'driver-postgresql': { + 'src_name': 'driver_postgresql', + 'sources': [ + 'postgres_type_test.cc', + 'postgresql_test.cc', + ] + }, + 'driver-postgresql-copy': { + 'src_name': 'driver_postgresql_copy', + 'sources': [ + 'copy/postgres_copy_reader_test.cc', + 'copy/postgres_copy_writer_test.cc', + ] + }, + } + + foreach nm, conf : postgres_tests + exc = executable( + 'adbc-' + nm + '-test', + sources: conf['sources'], + include_directories: [root_dir, driver_dir], + link_with: [ + adbc_common_lib, + adbc_postgres_driver_lib, + adbc_validation_lib, + adbc_validation_util_lib, + ], + dependencies: [nanoarrow_dep, gtest_main_dep, gmock_dep, libpq_dep], + ) + test('adbc-' + nm, exc) Review Comment: ```suggestion test('adbc-' + name, exc) ``` ########## CONTRIBUTING.md: ########## @@ -148,6 +148,43 @@ for details. [cmake-prefix-path]: https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html [gtest]: https://github.com/google/googletest/ +### C/C++ with Meson + +While CMake is the officially supported build generator, there is limited, +experimental support for the Meson build system. Meson offers arguably better +dependency management than CMake, with a syntax that Python developers may +find more readable. + +To use Meson, start at the c directory and run: + +```shell +$ meson setup build +``` + +For a full list of options, ``meson configure`` will bring up a pager +with sections that you can navigate. The "Project Options" section in particular +will show you what ADBC has to offer, and each option can be provided using +the form ``-D_option_:_value_``. For example, to build the a debug version of +the SQLite3 driver along with tests, you would run: + +```shell +$ meson configure -Dbuildtype=debug -Dsqlite=true -Dtests=true build +``` + +With the options set, you can then compile the project. For most dependencies, +Meson will try to find them on your system and fall back to downloading a copy +from its WrapDB for you: + +```shell Review Comment: ```suggestion ```console ``` ########## c/meson.build: ########## @@ -0,0 +1,77 @@ +# 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. + +project( + 'arrow-adbc', + 'c', 'cpp', + version: '1.1.0-SNAPSHOT', + license: 'Apache 2.0', Review Comment: ```suggestion license: 'Apache-2.0', ``` ########## CONTRIBUTING.md: ########## @@ -148,6 +148,43 @@ for details. [cmake-prefix-path]: https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html [gtest]: https://github.com/google/googletest/ +### C/C++ with Meson + +While CMake is the officially supported build generator, there is limited, +experimental support for the Meson build system. Meson offers arguably better +dependency management than CMake, with a syntax that Python developers may +find more readable. + +To use Meson, start at the c directory and run: + +```shell +$ meson setup build +``` + +For a full list of options, ``meson configure`` will bring up a pager +with sections that you can navigate. The "Project Options" section in particular +will show you what ADBC has to offer, and each option can be provided using +the form ``-D_option_:_value_``. For example, to build the a debug version of +the SQLite3 driver along with tests, you would run: + +```shell +$ meson configure -Dbuildtype=debug -Dsqlite=true -Dtests=true build +``` + +With the options set, you can then compile the project. For most dependencies, +Meson will try to find them on your system and fall back to downloading a copy +from its WrapDB for you: + +```shell +$ meson compile -C build +``` + +To run the test suite, simply run: + +```shell Review Comment: ```suggestion ```console ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
