Skip to content

Commit

Permalink
Add empty abi test that links the arrow c++ library
Browse files Browse the repository at this point in the history
  • Loading branch information
ankoh committed May 17, 2021
1 parent 6d160fa commit 0c5760f
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ local.properties

# Clang language server (C/C++ tooling)
/.cache/clangd
.ccls-cache

# Eclipse Core
.project
Expand Down
4 changes: 4 additions & 0 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ endif()
if(BUILD_R)
add_subdirectory(rpkg)
endif()

if(BUILD_ARROW_ABI_TEST)
add_subdirectory(arrow_abi_test)
endif()
75 changes: 75 additions & 0 deletions tools/arrow_abi_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
include(ExternalProject)

ExternalProject_Add(
arrow_ep
GIT_REPOSITORY "https://github.com/apache/arrow"
GIT_TAG f959141ece4d660bce5f7fa545befc0116a7db79
PREFIX "${CMAKE_BINARY_DIR}/third_party/arrow"
INSTALL_DIR "${CMAKE_BINARY_DIR}/third_party/arrow/install"
CONFIGURE_COMMAND
${CMAKE_COMMAND}
-G${CMAKE_GENERATOR}
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/third_party/arrow/install
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DARROW_ALTIVEC=OFF
-DARROW_USE_CCACHE=ON
-DARROW_BOOST_USE_SHARED=OFF
-DARROW_BUILD_SHARED=OFF
-DARROW_BUILD_STATIC=ON
-DARROW_BUILD_UTILITIES=OFF
-DARROW_COMPUTE=OFF
-DARROW_DATASET=OFF
-DARROW_FLIGHT=OFF
-DARROW_GFLAGS_USE_SHARED=OFF
-DARROW_HDFS=OFF
-DARROW_IPC=ON
-DARROW_JSON=ON
-DARROW_CSV=OFF
-DARROW_JEMALLOC=OFF
-DARROW_ORC=OFF
-DARROW_PARQUET=OFF
-DARROW_PROTOBUF_USE_SHARED=OFF
-DARROW_USE_GLOG=OFF
-DARROW_SIMD_LEVEL=NONE
-DARROW_RUNTIME_SIMD_LEVEL=NONE
-DARROW_WITH_BROTLI=OFF
-DARROW_WITH_LZ4=OFF
-DARROW_WITH_PROTOBUF=OFF
-DARROW_WITH_RAPIDJSON=OFF
-DARROW_WITH_SNAPPY=OFF
-DARROW_WITH_ZLIB=OFF
-DARROW_WITH_ZSTD=OFF
-DBOOST_SOURCE=AUTO
<SOURCE_DIR>/cpp
UPDATE_COMMAND ""
BUILD_BYPRODUCTS
<INSTALL_DIR>/lib/libarrow.a
)

ExternalProject_Get_Property(arrow_ep install_dir)
set(ARROW_INCLUDE_DIR ${install_dir}/include)
set(ARROW_LIBRARY_PATH ${install_dir}/lib/libarrow.a)
file(MAKE_DIRECTORY ${ARROW_INCLUDE_DIR})

add_library(arrow STATIC IMPORTED)
set_property(TARGET arrow PROPERTY IMPORTED_LOCATION ${ARROW_LIBRARY_PATH})
set_property(TARGET arrow APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ARROW_INCLUDE_DIR})
add_dependencies(arrow arrow_ep)

add_executable(arrow_abi_test
${CMAKE_CURRENT_SOURCE_DIR}/abi_test.cc
)

include_directories(arrow_abi_test
${CMAKE_CURRENT_SOURCE_DIR}/../../src/include
${CMAKE_CURRENT_SOURCE_DIR}/../../third_party/catch
)
target_link_libraries(arrow_abi_test arrow)
5 changes: 5 additions & 0 deletions tools/arrow_abi_test/abi_test.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "catch.hpp"

int main() {
return 0;
}

0 comments on commit 0c5760f

Please sign in to comment.