Skip to content
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
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ 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)
option(ICEBERG_AVRO "Build Avro" ON)
option(ICEBERG_BUILD_BUNDLE "Build the battery included library" ON)

include(GNUInstallDirs)
include(FetchContent)
Expand All @@ -46,7 +45,7 @@ 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}")
set(ICEBERG_INSTALL_DOCDIR "share/doc/Iceberg")

if(WIN32 AND NOT MINGW)
set(MSVC_TOOLCHAIN TRUE)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ ctest --test-dir build --output-on-failure
cmake --install build
```

### Build and Install Iceberg Arrow Library
### Build and Install Iceberg Bundle Library

#### Vendored Apache Arrow (default)

```bash
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/path/to/install -DICEBERG_ARROW=ON
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/path/to/install -DICEBERG_BUILD_BUNDLE=ON
cmake --build build
ctest --test-dir build --output-on-failure
cmake --install build
Expand All @@ -52,7 +52,7 @@ 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 -S . -B build -DCMAKE_INSTALL_PREFIX=/path/to/install -DCMAKE_PREFIX_PATH=/path/to/arrow -DICEBERG_BUILD_BUNDLE=ON
cmake --build build
ctest --test-dir build --output-on-failure
cmake --install build
Expand Down
4 changes: 2 additions & 2 deletions cmake_modules/IcebergThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function(resolve_arrow_dependency)
PARENT_SCOPE)
endfunction()

if(ICEBERG_ARROW)
if(ICEBERG_BUILD_BUNDLE)
resolve_arrow_dependency()
endif()

Expand Down Expand Up @@ -199,7 +199,7 @@ function(resolve_avro_dependency)
PARENT_SCOPE)
endfunction()

if(ICEBERG_AVRO)
if(ICEBERG_BUILD_BUNDLE)
resolve_avro_dependency()
endif()

Expand Down
4 changes: 1 addition & 3 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,4 @@ find_package(Iceberg CONFIG REQUIRED)

add_executable(demo_example demo_example.cc)

target_link_libraries(demo_example
PRIVATE Iceberg::iceberg_puffin_static
Iceberg::iceberg_arrow_static Iceberg::iceberg_avro_static)
target_link_libraries(demo_example PRIVATE Iceberg::iceberg_bundle_static)
2 changes: 0 additions & 2 deletions example/demo_example.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@
#include "iceberg/arrow/demo_arrow.h"
#include "iceberg/avro/demo_avro.h"
#include "iceberg/demo.h"
#include "iceberg/puffin/demo_puffin.h"

int main() {
std::cout << iceberg::Demo().print() << std::endl;
std::cout << iceberg::puffin::DemoPuffin().print() << std::endl;
std::cout << iceberg::arrow::DemoArrow().print() << std::endl;
std::cout << iceberg::avro::DemoAvro().print() << std::endl;
return 0;
Expand Down
58 changes: 55 additions & 3 deletions src/iceberg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,63 @@ add_iceberg_lib(iceberg

iceberg_install_all_headers(iceberg)

add_subdirectory(util)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/iceberg_export.h
DESTINATION ${ICEBERG_INSTALL_INCLUDEDIR}/iceberg)

add_subdirectory(arrow)
add_subdirectory(avro)
add_subdirectory(puffin)
if(ICEBERG_BUILD_BUNDLE)
set(ICEBERG_BUNDLE_SOURCES arrow/demo_arrow.cc avro/demo_avro.cc)

# Libraries to link with exported libiceberg_bundle.{so,a}.
set(ICEBERG_BUNDLE_STATIC_BUILD_INTERFACE_LIBS)
set(ICEBERG_BUNDLE_SHARED_BUILD_INTERFACE_LIBS)
set(ICEBERG_BUNDLE_STATIC_INSTALL_INTERFACE_LIBS)
set(ICEBERG_BUNDLE_SHARED_INSTALL_INTERFACE_LIBS)

list(APPEND
ICEBERG_BUNDLE_STATIC_BUILD_INTERFACE_LIBS
"$<IF:$<TARGET_EXISTS:iceberg_static>,iceberg_static,iceberg_shared>"
"$<IF:$<TARGET_EXISTS:Arrow::arrow_static>,Arrow::arrow_static,Arrow::arrow_shared>"
"$<IF:$<TARGET_EXISTS:Avro::avrocpp_static>,Avro::avrocpp_static,Avro::avrocpp_shared>"
)
list(APPEND
ICEBERG_BUNDLE_SHARED_BUILD_INTERFACE_LIBS
"$<IF:$<TARGET_EXISTS:iceberg_shared>,iceberg_shared,iceberg_static>"
"$<IF:$<TARGET_EXISTS:Arrow::arrow_shared>,Arrow::arrow_shared,Arrow::arrow_static>"
"$<IF:$<TARGET_EXISTS:Avro::avrocpp_shared>,Avro::avrocpp_shared,Avro::avrocpp_static>"
)

list(APPEND
ICEBERG_BUNDLE_STATIC_INSTALL_INTERFACE_LIBS
"$<IF:$<TARGET_EXISTS:Iceberg::iceberg_static>,Iceberg::iceberg_static,Iceberg::iceberg_shared>"
"$<IF:$<BOOL:${ARROW_VENDORED}>,Iceberg::arrow_static,$<IF:$<TARGET_EXISTS:Arrow::arrow_static>,Arrow::arrow_static,Arrow::arrow_shared>>"
"$<IF:$<BOOL:${AVRO_VENDORED}>,Iceberg::avrocpp_s,$<IF:$<TARGET_EXISTS:Avro::avrocpp_static>,Avro::avrocpp_static,Avro::avrocpp_shared>>"
)
list(APPEND
ICEBERG_BUNDLE_SHARED_INSTALL_INTERFACE_LIBS
"$<IF:$<TARGET_EXISTS:Iceberg::iceberg_shared>,Iceberg::iceberg_shared,Iceberg::iceberg_static>"
"$<IF:$<BOOL:${ARROW_VENDORED}>,Iceberg::arrow_static,$<IF:$<TARGET_EXISTS:Arrow::arrow_shared>,Arrow::arrow_shared,Arrow::arrow_static>>"
"$<IF:$<BOOL:${AVRO_VENDORED}>,Iceberg::avrocpp_s,$<IF:$<TARGET_EXISTS:Avro::avrocpp_shared>,Avro::avrocpp_shared,Avro::avrocpp_static>>"
)

add_iceberg_lib(iceberg_bundle
SOURCES
${ICEBERG_BUNDLE_SOURCES}
SHARED_LINK_LIBS
${ICEBERG_BUNDLE_SHARED_BUILD_INTERFACE_LIBS}
STATIC_LINK_LIBS
${ICEBERG_BUNDLE_STATIC_BUILD_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
${ICEBERG_BUNDLE_STATIC_INSTALL_INTERFACE_LIBS}
SHARED_INSTALL_INTERFACE_LIBS
${ICEBERG_BUNDLE_SHARED_INSTALL_INTERFACE_LIBS})

add_subdirectory(arrow)
add_subdirectory(avro)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/iceberg_bundle_export.h
DESTINATION ${ICEBERG_INSTALL_INCLUDEDIR}/iceberg)
endif()

iceberg_install_cmake_package(Iceberg iceberg_targets)
6 changes: 2 additions & 4 deletions src/iceberg/IcebergConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
#
# Iceberg::iceberg_shared
# Iceberg::iceberg_static
# Iceberg::iceberg_puffin_shared
# Iceberg::iceberg_puffin_static
# Iceberg::iceberg_arrow_shared
# Iceberg::iceberg_arrow_static
# Iceberg::iceberg_bundle_shared
# Iceberg::iceberg_bundle_static

@PACKAGE_INIT@

Expand Down
57 changes: 0 additions & 57 deletions src/iceberg/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,61 +15,4 @@
# specific language governing permissions and limitations
# under the License.

if(NOT ICEBERG_ARROW)
return()
endif()

set(ICEBERG_ARROW_SOURCES demo_arrow.cc)

# Libraries to link with exported libiceberg_arrow.{so,a}.
set(ICEBERG_ARROW_STATIC_BUILD_INTERFACE_LIBS)
set(ICEBERG_ARROW_SHARED_BUILD_INTERFACE_LIBS)
set(ICEBERG_ARROW_STATIC_INSTALL_INTERFACE_LIBS)
set(ICEBERG_ARROW_SHARED_INSTALL_INTERFACE_LIBS)

list(APPEND ICEBERG_ARROW_STATIC_BUILD_INTERFACE_LIBS
"$<IF:$<TARGET_EXISTS:iceberg_static>,iceberg_static,iceberg_shared>"
"$<IF:$<TARGET_EXISTS:Arrow::arrow_static>,Arrow::arrow_static,Arrow::arrow_shared>")
list(APPEND ICEBERG_ARROW_SHARED_BUILD_INTERFACE_LIBS
"$<IF:$<TARGET_EXISTS:iceberg_shared>,iceberg_shared,iceberg_static>"
"$<IF:$<TARGET_EXISTS:Arrow::arrow_shared>,Arrow::arrow_shared,Arrow::arrow_static>")

if(ARROW_VENDORED)
list(APPEND ICEBERG_ARROW_STATIC_INSTALL_INTERFACE_LIBS Iceberg::arrow_static)
list(APPEND ICEBERG_ARROW_SHARED_INSTALL_INTERFACE_LIBS Iceberg::arrow_static)
else()
list(APPEND
ICEBERG_ARROW_STATIC_INSTALL_INTERFACE_LIBS
"$<IF:$<TARGET_EXISTS:Arrow::arrow_static>,Arrow::arrow_static,Arrow::arrow_shared>"
)
list(APPEND
ICEBERG_ARROW_SHARED_INSTALL_INTERFACE_LIBS
"$<IF:$<TARGET_EXISTS:Arrow::arrow_shared>,Arrow::arrow_shared,Arrow::arrow_static>"
)
endif()

list(APPEND
ICEBERG_ARROW_STATIC_INSTALL_INTERFACE_LIBS
"$<IF:$<TARGET_EXISTS:Iceberg::iceberg_static>,Iceberg::iceberg_static,Iceberg::iceberg_shared>"
)
list(APPEND
ICEBERG_ARROW_SHARED_INSTALL_INTERFACE_LIBS
"$<IF:$<TARGET_EXISTS:Iceberg::iceberg_shared>,Iceberg::iceberg_shared,Iceberg::iceberg_static>"
)

add_iceberg_lib(iceberg_arrow
SOURCES
${ICEBERG_ARROW_SOURCES}
SHARED_LINK_LIBS
${ICEBERG_ARROW_SHARED_BUILD_INTERFACE_LIBS}
STATIC_LINK_LIBS
${ICEBERG_ARROW_STATIC_BUILD_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
${ICEBERG_ARROW_STATIC_INSTALL_INTERFACE_LIBS}
SHARED_INSTALL_INTERFACE_LIBS
${ICEBERG_ARROW_SHARED_INSTALL_INTERFACE_LIBS})

iceberg_install_all_headers(iceberg/arrow)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/iceberg_arrow_export.h
DESTINATION ${ICEBERG_INSTALL_INCLUDEDIR}/iceberg/arrow)
4 changes: 2 additions & 2 deletions src/iceberg/arrow/demo_arrow.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

#include <string>

#include "iceberg/arrow/iceberg_arrow_export.h"
#include "iceberg/demo.h"
#include "iceberg/iceberg_bundle_export.h"

namespace iceberg::arrow {

class ICEBERG_ARROW_EXPORT DemoArrow : public Demo {
class ICEBERG_BUNDLE_EXPORT DemoArrow : public Demo {
public:
DemoArrow() = default;
~DemoArrow() override = default;
Expand Down
61 changes: 0 additions & 61 deletions src/iceberg/avro/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,65 +15,4 @@
# specific language governing permissions and limitations
# under the License.

if(NOT ICEBERG_AVRO)
return()
endif()

set(ICEBERG_AVRO_SOURCES demo_avro.cc)

# Libraries to link with exported libiceberg_avro.{so,a}.
set(ICEBERG_AVRO_STATIC_BUILD_INTERFACE_LIBS)
set(ICEBERG_AVRO_SHARED_BUILD_INTERFACE_LIBS)
set(ICEBERG_AVRO_STATIC_INSTALL_INTERFACE_LIBS)
set(ICEBERG_AVRO_SHARED_INSTALL_INTERFACE_LIBS)

list(APPEND
ICEBERG_AVRO_STATIC_BUILD_INTERFACE_LIBS
"$<IF:$<TARGET_EXISTS:iceberg_static>,iceberg_static,iceberg_shared>"
"$<IF:$<TARGET_EXISTS:Avro::avrocpp_static>,Avro::avrocpp_static,Avro::avrocpp_shared>"
)
list(APPEND
ICEBERG_AVRO_SHARED_BUILD_INTERFACE_LIBS
"$<IF:$<TARGET_EXISTS:iceberg_shared>,iceberg_shared,iceberg_static>"
"$<IF:$<TARGET_EXISTS:Avro::avrocpp_shared>,Avro::avrocpp_shared,Avro::avrocpp_static>"
)

if(AVRO_VENDORED)
list(APPEND ICEBERG_AVRO_STATIC_INSTALL_INTERFACE_LIBS Iceberg::avrocpp_s)
list(APPEND ICEBERG_AVRO_SHARED_INSTALL_INTERFACE_LIBS Iceberg::avrocpp_s)
else()
list(APPEND
ICEBERG_AVRO_STATIC_INSTALL_INTERFACE_LIBS
"$<IF:$<TARGET_EXISTS:Avro::avrocpp_static>,Avro::avrocpp_static,Avro::avrocpp_shared>"
)
list(APPEND
ICEBERG_AVRO_SHARED_INSTALL_INTERFACE_LIBS
"$<IF:$<TARGET_EXISTS:Avro::avrocpp_shared>,Avro::avrocpp_shared,Avro::avrocpp_static>"
)
endif()

list(APPEND
ICEBERG_AVRO_STATIC_INSTALL_INTERFACE_LIBS
"$<IF:$<TARGET_EXISTS:Iceberg::iceberg_static>,Iceberg::iceberg_static,Iceberg::iceberg_shared>"
)
list(APPEND
ICEBERG_AVRO_SHARED_INSTALL_INTERFACE_LIBS
"$<IF:$<TARGET_EXISTS:Iceberg::iceberg_shared>,Iceberg::iceberg_shared,Iceberg::iceberg_static>"
)

add_iceberg_lib(iceberg_avro
SOURCES
${ICEBERG_AVRO_SOURCES}
SHARED_LINK_LIBS
${ICEBERG_AVRO_SHARED_BUILD_INTERFACE_LIBS}
STATIC_LINK_LIBS
${ICEBERG_AVRO_STATIC_BUILD_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
${ICEBERG_AVRO_STATIC_INSTALL_INTERFACE_LIBS}
SHARED_INSTALL_INTERFACE_LIBS
${ICEBERG_AVRO_SHARED_INSTALL_INTERFACE_LIBS})

iceberg_install_all_headers(iceberg/avro)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/iceberg_avro_export.h
DESTINATION ${ICEBERG_INSTALL_INCLUDEDIR}/iceberg/avro)
4 changes: 2 additions & 2 deletions src/iceberg/avro/demo_avro.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
#include <string>

#include "iceberg/avro.h"
#include "iceberg/avro/iceberg_avro_export.h"
#include "iceberg/iceberg_bundle_export.h"

namespace iceberg::avro {

class ICEBERG_AVRO_EXPORT DemoAvro : public Avro {
class ICEBERG_BUNDLE_EXPORT DemoAvro : public Avro {
public:
DemoAvro() = default;
~DemoAvro() override = default;
Expand Down
1 change: 0 additions & 1 deletion src/iceberg/demo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "iceberg/avro.h" // include to export symbols
#include "iceberg/catalog.h"
#include "iceberg/location_provider.h"
#include "iceberg/puffin.h"
#include "iceberg/table.h"
#include "iceberg/transaction.h"

Expand Down
34 changes: 0 additions & 34 deletions src/iceberg/puffin.h

This file was deleted.

Loading
Loading