Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
65021dc
Add iceberg_arrow library
wgtmac Dec 6, 2024
f84b307
fix linux build
wgtmac Dec 26, 2024
2cfd715
use internal cmake variables
wgtmac Dec 26, 2024
10ef3e5
fix windows build
wgtmac Dec 26, 2024
200bd2f
fix msvc build to not add _static suffix
wgtmac Dec 26, 2024
b750758
remove MSVC_TOOLCHAIN
wgtmac Dec 27, 2024
4e766d9
simplify ThirdpartyToolchain.cmake
wgtmac Dec 31, 2024
2866d6e
use same target
wgtmac Dec 31, 2024
5183981
simplify vendored lib
wgtmac Dec 31, 2024
312b13d
use PackageNameConfig
wgtmac Dec 31, 2024
3c5bdfb
Update README.md
wgtmac Dec 31, 2024
a6abfd4
Update cmake_modules/ThirdpartyToolchain.cmake
wgtmac Dec 31, 2024
8c09208
Update src/arrow/CMakeLists.txt
wgtmac Dec 31, 2024
80e0a4b
let libiceberg_arrow depend on libiceberg_core
wgtmac Jan 1, 2025
5a064c9
add back MSVC_TOOLCHAIN
wgtmac Jan 1, 2025
93c4228
try to fix windows build
wgtmac Jan 1, 2025
fdc0294
add visibility.h
wgtmac Jan 1, 2025
3f6df87
move iceberg_core location
wgtmac Jan 1, 2025
cbd661d
link core to puffin & arrow
wgtmac Jan 1, 2025
38a9259
let iceberg_arrow to call api from iceberg_core
wgtmac Jan 1, 2025
59bb135
remove api folder
wgtmac Jan 2, 2025
64c8e29
fix lint
wgtmac Jan 2, 2025
0d337bd
use generate_export_header
wgtmac Jan 2, 2025
149ed21
fix cmake lint
wgtmac Jan 2, 2025
2cb3dc9
add STATIC_DEFINE
wgtmac Jan 2, 2025
d88b5ee
try to fix windows export
wgtmac Jan 2, 2025
79bba23
try to fix windows export
wgtmac Jan 2, 2025
be17441
try to fix windows export
wgtmac Jan 2, 2025
254bebe
use instead of
wgtmac Jan 3, 2025
24acdac
remove definition of LIB_NAME_shared_EXPORTS
wgtmac Jan 3, 2025
e31ae78
Revert "remove definition of LIB_NAME_shared_EXPORTS"
wgtmac Jan 3, 2025
4553485
remove shared_EXPORTS
wgtmac Jan 6, 2025
9c065c6
fix lint
wgtmac Jan 6, 2025
343aa9b
Update cmake_modules/BuildUtils.cmake
wgtmac Jan 7, 2025
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
21 changes: 13 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")

project(iceberg
project(Iceberg
VERSION 0.1.0
DESCRIPTION "Iceberg C++ Project"
LANGUAGES CXX)
Expand All @@ -36,21 +36,26 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(ICEBERG_BUILD_STATIC "Build static library" ON)
option(ICEBERG_BUILD_SHARED "Build shared library" OFF)
option(ICEBERG_BUILD_TESTS "Build tests" ON)
option(ICEBERG_ARROW "Build Arrow" ON)

include(CMakePackageConfigHelpers)
include(CMakeParseArguments)
include(BuildUtils)
include(ExternalProject)
include(FindPackageHandleStandardArgs)
include(GNUInstallDirs)

set(ICEBERG_API_DIR "${CMAKE_SOURCE_DIR}/api")
set(ICEBERG_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
set(ICEBERG_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}")
set(ICEBERG_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
set(ICEBERG_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake")
set(ICEBERG_INSTALL_DOCDIR "share/doc/${PROJECT_NAME}")

if(WIN32 AND NOT MINGW)
set(MSVC_TOOLCHAIN TRUE)
else()
set(MSVC_TOOLCHAIN FALSE)
endif()

include(CMakeParseArguments)
include(BuildUtils)
include(ThirdpartyToolchain)

add_subdirectory(api)
add_subdirectory(src)

Expand Down
36 changes: 29 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,27 @@ C++ implementation of [Apache Iceberg™](https://iceberg.apache.org/).

```bash
cd iceberg-cpp
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/tmp/iceberg -DICEBERG_BUILD_STATIC=ON -DICEBERG_BUILD_SHARED=ON
cmake --build .
cmake --install .
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/path/to/install -DICEBERG_BUILD_STATIC=ON -DICEBERG_BUILD_SHARED=ON
cmake --build build
cmake --install build
```

### Build and Install Iceberg Arrow Library

#### Vendored Apache Arrow (default)

```bash
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/path/to/install -DICEBERG_ARROW=ON
cmake --build build
cmake --install build
```

#### Provided Apache Arrow

```bash
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/path/to/install -DCMAKE_PREFIX_PATH=/path/to/arrow -DICEBERG_ARROW=ON
cmake --build build
cmake --install build
```

### Build Examples
Expand All @@ -44,9 +61,14 @@ After installing the core libraries, you can build the examples:

```bash
cd iceberg-cpp/example
mkdir build && cd build
cmake .. -DCMAKE_PREFIX_PATH=/tmp/iceberg
cmake --build .
cmake -S . -B build -DCMAKE_PREFIX_PATH=/path/to/install
cmake --build build
```

If you are using provided Apache Arrow, you need to include `/path/to/arrow` in `CMAKE_PREFIX_PATH` as below.

```bash
cmake -S . -B build -DCMAKE_PREFIX_PATH="/path/to/install;/path/to/arrow"
```

## Contribute
Expand Down
4 changes: 3 additions & 1 deletion api/iceberg/puffin.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
#include <memory>
#include <string_view>

#include "iceberg/visibility.h"

namespace iceberg {

class Puffin {
class ICEBERG_EXPORT Puffin {
public:
virtual ~Puffin() = default;
virtual std::string_view print() const = 0;
Expand Down
4 changes: 3 additions & 1 deletion api/iceberg/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
#include <memory>
#include <string_view>

#include "iceberg/visibility.h"

namespace iceberg {

class Table {
class ICEBERG_EXPORT Table {
public:
virtual ~Table() = default;
virtual std::string_view print() const = 0;
Expand Down
34 changes: 34 additions & 0 deletions api/iceberg/visibility.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* 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.
*/

#pragma once

#if defined(_WIN32) || defined(__CYGWIN__)
# ifdef ICEBERG_STATIC
# define ICEBERG_EXPORT
# else
# ifdef ICEBERG_EXPORTING
# define ICEBERG_EXPORT __declspec(dllexport)
# else
# define ICEBERG_EXPORT __declspec(dllimport)
# endif
# endif
#else
# define ICEBERG_EXPORT
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to prepare this for each shared library. (We need ICEBERG_CORE_EXPORT/ICEBERG_PUFFIN_EXPORT/ICEBERG_ARROW_EXPORT.)
Because libiceberg_arrow.dll will use exported symbols in libiceberg_core.dll. In this case, libiceberg_arrow.dll uses _declspec(dllexport) for libiceberg_arrow.dll symbols and _declspec(dllimport) for libiceberg_core.dll symbols.

Copy link
Member Author

@wgtmac wgtmac Jan 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. What if we define ICEBERG_EXPORTING to all of libiceberg_core.dll, libiceberg_arrow.dll and libiceberg_puffin.dll? I think we can simply keep the same visibility to all libraries for now because the core library provides the API and core logic while puffin and arrow provide concrete implementations of the core library.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it causes link errors. If libiceberg_arrow.dll uses a libiceberg_core.dll symbol, libiceberg_arrow.dll uses __declspec(dllexport)-ed libiceberg_core.dll symbols...

Can we add a simple function to libiceberg_core.dll and use it from libiceberg_arrow.dll?

Copy link
Member Author

@wgtmac wgtmac Jan 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try it on my Windows PC tonight. Thanks!

EDIT: I have added a new function DemoTable::name() in demo_table.h and called it in demo_arrow.cc. It does not have linking error. @kou

Copy link
Member Author

@wgtmac wgtmac Jan 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is relevant to how we manage the public headers from different iceberg libraries. As per previous discussion, we use a separate api folder holds all public header files from all libraries (i.e. core, puffin, arrow, etc.). IIUC, the current approach makes it difficult to manage the visibility of the header file across libraries. I'd propose to remove the current api folder and let each library manage its own header files. WDYT? @kou @raulcd @zhjwpku @gaborkaszab @lidavidm @pitrou

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having separate directories per library is reasonable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added a new function DemoTable::name() in demo_table.h and called it in demo_arrow.cc. It does not have linking error.

Hmm. It may have a real world problem because libiceberg_arrow.lib is always used with libiceberg_core.lib...
FYI: If we use the same ICEBERG_EXPORTING for all libraries, libiceberg_arrow.lib also exports symbols in libiceberg_core.dll but libiceberg_arrow.dll doesn't have them:

$ nm iceberg_arrow.lib | grep Demo
0000000000000000 T ??0DemoTable@iceberg@@QEAA@AEBV01@@Z
0000000000000000 I __imp_??0DemoTable@iceberg@@QEAA@AEBV01@@Z
0000000000000000 T ??0DemoTable@iceberg@@QEAA@XZ
0000000000000000 I __imp_??0DemoTable@iceberg@@QEAA@XZ
0000000000000000 T ??1DemoTable@iceberg@@UEAA@XZ
0000000000000000 I __imp_??1DemoTable@iceberg@@UEAA@XZ
0000000000000000 T ??4DemoArrow@arrow@iceberg@@QEAAAEAV012@$$QEAV012@@Z
0000000000000000 I __imp_??4DemoArrow@arrow@iceberg@@QEAAAEAV012@$$QEAV012@@Z
0000000000000000 T ??4DemoArrow@arrow@iceberg@@QEAAAEAV012@AEBV012@@Z
0000000000000000 I __imp_??4DemoArrow@arrow@iceberg@@QEAAAEAV012@AEBV012@@Z
0000000000000000 T ??4DemoTable@iceberg@@QEAAAEAV01@AEBV01@@Z
0000000000000000 I __imp_??4DemoTable@iceberg@@QEAAAEAV01@AEBV01@@Z
0000000000000000 I __imp_??_7DemoTable@iceberg@@6B@
0000000000000000 T ?name@DemoArrow@arrow@iceberg@@QEBA?AV?$basic_string_view@DU?$char_traits@D@std@@@std@@XZ
0000000000000000 I __imp_?name@DemoArrow@arrow@iceberg@@QEBA?AV?$basic_string_view@DU?$char_traits@D@std@@@std@@XZ
0000000000000000 T ?print@DemoArrow@arrow@iceberg@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ
0000000000000000 I __imp_?print@DemoArrow@arrow@iceberg@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ

If we use separated _EXPORTING macro for each library, DemoTable symbols aren't exported by libiceberg_arrow.dll:

$ nm iceberg_arrow.lib | grep Demo
0000000000000000 T ??4DemoArrow@arrow@iceberg@@QEAAAEAV012@$$QEAV012@@Z
0000000000000000 I __imp_??4DemoArrow@arrow@iceberg@@QEAAAEAV012@$$QEAV012@@Z
0000000000000000 T ??4DemoArrow@arrow@iceberg@@QEAAAEAV012@AEBV012@@Z
0000000000000000 I __imp_??4DemoArrow@arrow@iceberg@@QEAAAEAV012@AEBV012@@Z
0000000000000000 T ?name@DemoArrow@arrow@iceberg@@QEBA?AV?$basic_string_view@DU?$char_traits@D@std@@@std@@XZ
0000000000000000 I __imp_?name@DemoArrow@arrow@iceberg@@QEBA?AV?$basic_string_view@DU?$char_traits@D@std@@@std@@XZ
0000000000000000 T ?print@DemoArrow@arrow@iceberg@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ
0000000000000000 I __imp_?print@DemoArrow@arrow@iceberg@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd propose to remove the current api folder and let each library manage its own header files.

+1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed the api folder and move the header files to each library instead.

27 changes: 17 additions & 10 deletions cmake_modules/BuildUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
# Borrowed the file from Apache Arrow:
# https://github.com/apache/arrow/blob/main/cpp/cmake_modules/BuildUtils.cmake

include(CMakePackageConfigHelpers)

function(iceberg_install_cmake_package PACKAGE_NAME EXPORT_NAME)
set(CONFIG_CMAKE "${PACKAGE_NAME}Config.cmake")
set(BUILT_CONFIG_CMAKE "${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_CMAKE}")
Expand All @@ -37,12 +39,11 @@ function(iceberg_install_cmake_package PACKAGE_NAME EXPORT_NAME)
FILE "${TARGETS_CMAKE}")
endfunction()

function(ADD_ICEBERG_LIB LIB_NAME)
function(add_iceberg_lib LIB_NAME)
set(options)
set(one_value_args
BUILD_SHARED
BUILD_STATIC
CMAKE_PACKAGE_NAME
INSTALL_ARCHIVE_DIR
INSTALL_LIBRARY_DIR
INSTALL_RUNTIME_DIR
Expand Down Expand Up @@ -146,8 +147,8 @@ function(ADD_ICEBERG_LIB LIB_NAME)
"$<INSTALL_INTERFACE:${ARG_SHARED_INSTALL_INTERFACE_LIBS}>"
PRIVATE ${ARG_SHARED_PRIVATE_LINK_LIBS})

install(TARGETS ${LIB_NAME}_shared ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
install(TARGETS ${LIB_NAME}_shared
EXPORT iceberg_targets
ARCHIVE DESTINATION ${INSTALL_ARCHIVE_DIR}
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR}
Expand Down Expand Up @@ -201,23 +202,29 @@ function(ADD_ICEBERG_LIB LIB_NAME)
PUBLIC "$<BUILD_INTERFACE:${ARG_STATIC_LINK_LIBS}>")
endif()

install(TARGETS ${LIB_NAME}_static ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
install(TARGETS ${LIB_NAME}_static
EXPORT iceberg_targets
ARCHIVE DESTINATION ${INSTALL_ARCHIVE_DIR}
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR}
INCLUDES
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()

if(ARG_CMAKE_PACKAGE_NAME)
iceberg_install_cmake_package(${ARG_CMAKE_PACKAGE_NAME} ${LIB_NAME}_targets)
endif()

# Modify variable in calling scope
if(ARG_OUTPUTS)
set(${ARG_OUTPUTS}
${${ARG_OUTPUTS}}
PARENT_SCOPE)
endif()
endfunction()

function(iceberg_set_export_definitions STATIC_TARGET LIB_TARGETS)
if(ICEBERG_BUILD_STATIC AND WIN32)
target_compile_definitions(${STATIC_TARGET} PUBLIC ICEBERG_STATIC)
endif()

foreach(LIB_TARGET ${LIB_TARGETS})
target_compile_definitions(${LIB_TARGET} PRIVATE ICEBERG_EXPORTING)
endforeach()
endfunction()
132 changes: 132 additions & 0 deletions cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# 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.

# Accumulate all dependencies to provide suitable static link parameters to the
# third party libraries.
set(ICEBERG_SYSTEM_DEPENDENCIES)
set(ICEBERG_ARROW_INSTALL_INTERFACE_LIBS)

# ----------------------------------------------------------------------
# Versions and URLs for toolchain builds

set(ICEBERG_ARROW_BUILD_VERSION "18.1.0")
set(ICEBERG_ARROW_BUILD_SHA256_CHECKSUM
"2dc8da5f8796afe213ecc5e5aba85bb82d91520eff3cf315784a52d0fa61d7fc")

if(DEFINED ENV{ICEBERG_ARROW_URL})
set(ARROW_SOURCE_URL "$ENV{ICEBERG_ARROW_URL}")
else()
set(ARROW_SOURCE_URL
"https://www.apache.org/dyn/closer.lua?action=download&filename=/arrow/arrow-${ICEBERG_ARROW_BUILD_VERSION}/apache-arrow-${ICEBERG_ARROW_BUILD_VERSION}.tar.gz"
"https://downloads.apache.org/arrow/arrow-${ICEBERG_ARROW_BUILD_VERSION}/apache-arrow-${ICEBERG_ARROW_BUILD_VERSION}.tar.gz"
)
endif()

# ----------------------------------------------------------------------
# FetchContent

include(FetchContent)
set(FC_DECLARE_COMMON_OPTIONS)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.28)
list(APPEND FC_DECLARE_COMMON_OPTIONS EXCLUDE_FROM_ALL TRUE)
endif()

macro(prepare_fetchcontent)
set(BUILD_SHARED_LIBS OFF)
set(BUILD_STATIC_LIBS ON)
set(CMAKE_COMPILE_WARNING_AS_ERROR FALSE)
set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY TRUE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endmacro()

# ----------------------------------------------------------------------
# Apache Arrow

function(resolve_arrow_dependency)
prepare_fetchcontent()

set(ARROW_BUILD_SHARED
OFF
CACHE BOOL "" FORCE)
set(ARROW_BUILD_STATIC
ON
CACHE BOOL "" FORCE)
set(ARROW_FILESYSTEM
OFF
CACHE BOOL "" FORCE)
set(ARROW_SIMD_LEVEL
"NONE"
CACHE STRING "" FORCE)
set(ARROW_RUNTIME_SIMD_LEVEL
"NONE"
CACHE STRING "" FORCE)
set(ARROW_POSITION_INDEPENDENT_CODE
ON
CACHE BOOL "" FORCE)
set(ARROW_DEPENDENCY_SOURCE
"AUTO"
CACHE STRING "" FORCE)

fetchcontent_declare(Arrow
${FC_DECLARE_COMMON_OPTIONS}
URL ${ARROW_SOURCE_URL}
URL_HASH "SHA256=${ICEBERG_ARROW_BUILD_SHA256_CHECKSUM}"
SOURCE_SUBDIR
cpp
FIND_PACKAGE_ARGS
NAMES
Arrow
CONFIG)

# Add Arrow cmake modules to the search path
list(PREPEND CMAKE_MODULE_PATH
${CMAKE_CURRENT_BINARY_DIR}/_deps/arrow-src/cpp/cmake_modules)

fetchcontent_makeavailable(Arrow)

if(arrow_SOURCE_DIR)
if(NOT TARGET Arrow::arrow_static)
add_library(Arrow::arrow_static INTERFACE IMPORTED)
target_link_libraries(Arrow::arrow_static INTERFACE arrow_static)
target_include_directories(Arrow::arrow_static
INTERFACE ${arrow_BINARY_DIR}/src
${arrow_SOURCE_DIR}/cpp/src)
endif()

set(ARROW_VENDORED TRUE)
set_target_properties(arrow_static PROPERTIES OUTPUT_NAME "iceberg_vendored_arrow")
install(TARGETS arrow_static
EXPORT iceberg_targets
RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}"
ARCHIVE DESTINATION "${ICEBERG_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
else()
set(ARROW_VENDORED FALSE)
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES Arrow)
endif()

set(ICEBERG_SYSTEM_DEPENDENCIES
${ICEBERG_SYSTEM_DEPENDENCIES}
PARENT_SCOPE)
set(ARROW_VENDORED
${ARROW_VENDORED}
PARENT_SCOPE)
endfunction()

if(ICEBERG_ARROW)
resolve_arrow_dependency()
endif()
7 changes: 3 additions & 4 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ project(example)

set(CMAKE_CXX_STANDARD 20)

find_package(iceberg CONFIG REQUIRED)
find_package(puffin CONFIG REQUIRED)
find_package(Iceberg CONFIG REQUIRED)

add_executable(demo_example demo_example.cc)

target_link_libraries(demo_example PRIVATE iceberg::iceberg_core_static
puffin::iceberg_puffin_static)
target_link_libraries(demo_example PRIVATE Iceberg::iceberg_puffin_static
Iceberg::iceberg_arrow_static)
3 changes: 3 additions & 0 deletions example/demo_example.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@

#include <iostream>

#include "iceberg/arrow/demo_arrow.h"
#include "iceberg/puffin.h"
#include "iceberg/table.h"

int main() {
std::cout << iceberg::Table::create()->print() << std::endl;
std::cout << iceberg::Puffin::create()->print() << std::endl;
std::cout << iceberg::arrow::DemoArrow().print() << std::endl;
std::cout << iceberg::arrow::DemoArrow().name() << std::endl;
return 0;
}
Loading
Loading