lidavidm commented on code in PR #597: URL: https://github.com/apache/arrow-adbc/pull/597#discussion_r1173154338
########## c/driver/common/CMakeLists.txt: ########## @@ -0,0 +1,20 @@ +# 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. + +add_library(adbc_driver_common STATIC utils.c) +include_directories(SYSTEM ${REPOSITORY_ROOT}) Review Comment: All(?) references to REPOSITORY_ROOT can be replaced with a proper CMake variable (CMAKE_SOURCE_DIR I think) ########## c/CMakeLists.txt: ########## @@ -0,0 +1,43 @@ +# 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. + +cmake_minimum_required(VERSION 3.18) +get_filename_component(REPOSITORY_ROOT ".." ABSOLUTE) +message(STATUS "${REPOSITORY_ROOT}") +list(APPEND CMAKE_MODULE_PATH "${REPOSITORY_ROOT}/c/cmake_modules/") +include(AdbcDefines) +include(BuildUtils) + +project(adbc + VERSION "${ADBC_BASE_VERSION}" + LANGUAGES CXX) +include(CTest) + +add_subdirectory(vendor/nanoarrow) +add_subdirectory(driver/common) + +if(ADBC_BUILD_DRIVER_MANAGER) Review Comment: nit: arrow just uses `ARROW_COMPONENT`, can we use `ADBC_COMPONENT`? ########## c/vendor/nanoarrow/CMakeLists.txt: ########## @@ -16,11 +15,12 @@ # specific language governing permissions and limitations # under the License. -main() { - local CMAKE_BINARY_DIR="$1" - local TEST_OR_BENCHMARK="$2" - local TEST_PATH="$3" - exec "${CMAKE_BINARY_DIR}/${TEST_PATH}" -} +# Common definitions for the CMake projects in this repository. +# Must define REPOSITORY_ROOT before including this. Review Comment: Copy-paste? ########## c/driver/postgresql/CMakeLists.txt: ########## @@ -53,14 +42,15 @@ add_arrow_lib(adbc_driver_postgresql ${ADBC_LINK_FLAGS} SHARED_LINK_LIBS ${LIBPQ_LINK_LIBRARIES} - nanoarrow STATIC_LINK_LIBS ${LIBPQ_LINK_LIBRARIES} nanoarrow ${LIBPQ_STATIC_LIBRARIES}) include_directories(SYSTEM ${REPOSITORY_ROOT}) include_directories(SYSTEM ${REPOSITORY_ROOT}/c/) include_directories(SYSTEM ${LIBPQ_INCLUDE_DIRS}) +include_directories(SYSTEM ${REPOSITORY_ROOT}/c/vendor) Review Comment: Ideally we should use target_include_directories now that we have multiple targets -- 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]
