|
1 | | -# Licensed to the Apache Software Foundation (ASF) under one |
2 | | -# or more contributor license agreements. See the NOTICE file |
3 | | -# distributed with this work for additional information |
4 | | -# regarding copyright ownership. The ASF licenses this file |
5 | | -# to you under the Apache License, Version 2.0 (the |
6 | | -# "License"); you may not use this file except in compliance |
7 | | -# with the License. You may obtain a copy of the License at |
8 | | -# |
9 | | -# http://www.apache.org/licenses/LICENSE-2.0 |
10 | | -# |
11 | | -# Unless required by applicable law or agreed to in writing, |
12 | | -# software distributed under the License is distributed on an |
13 | | -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | | -# KIND, either express or implied. See the License for the |
15 | | -# specific language governing permissions and limitations |
16 | | -# under the License. |
| 1 | +# --- iceberg project CMake additions for Arrow S3 support --- |
| 2 | +option(ICEBERG_ENABLE_ARROW_S3 "Enable Arrow S3 integration (requires Arrow built with S3 support)" ON) |
17 | 3 |
|
18 | | -cmake_minimum_required(VERSION 3.25) |
19 | | - |
20 | | -if(NOT CMAKE_BUILD_TYPE) |
21 | | - set(CMAKE_BUILD_TYPE Debug) |
22 | | -endif() |
23 | | - |
24 | | -list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules") |
25 | | - |
26 | | -project(Iceberg |
27 | | - VERSION 0.2.0 |
28 | | - DESCRIPTION "Iceberg C++ Project" |
29 | | - LANGUAGES CXX) |
30 | | - |
31 | | -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/iceberg/version.h.in" |
32 | | - "${CMAKE_BINARY_DIR}/src/iceberg/version.h") |
33 | | - |
34 | | -set(CMAKE_CXX_STANDARD 23) |
35 | | -set(CMAKE_CXX_STANDARD_REQUIRED ON) |
36 | | -set(CMAKE_CXX_EXTENSIONS OFF) |
37 | | -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) |
38 | | -set(CMAKE_COMPILE_WARNING_AS_ERROR ON) |
39 | | - |
40 | | -option(ICEBERG_BUILD_STATIC "Build static library" ON) |
41 | | -option(ICEBERG_BUILD_SHARED "Build shared library" OFF) |
42 | | -option(ICEBERG_BUILD_TESTS "Build tests" ON) |
43 | | -option(ICEBERG_BUILD_BUNDLE "Build the battery included library" ON) |
44 | | -option(ICEBERG_BUILD_REST "Build rest catalog client" ON) |
45 | | -option(ICEBERG_BUILD_REST_INTEGRATION_TESTS "Build rest catalog integration tests" OFF) |
46 | | -option(ICEBERG_ENABLE_ASAN "Enable Address Sanitizer" OFF) |
47 | | -option(ICEBERG_ENABLE_UBSAN "Enable Undefined Behavior Sanitizer" OFF) |
48 | | - |
49 | | -include(GNUInstallDirs) |
50 | | -include(FetchContent) |
51 | | - |
52 | | -set(ICEBERG_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}") |
53 | | -set(ICEBERG_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}") |
54 | | -set(ICEBERG_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}") |
55 | | -set(ICEBERG_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake") |
56 | | -set(ICEBERG_INSTALL_DOCDIR "share/doc/iceberg") |
57 | | - |
58 | | -if(WIN32 AND NOT MINGW) |
59 | | - set(MSVC_TOOLCHAIN TRUE) |
60 | | -else() |
61 | | - set(MSVC_TOOLCHAIN FALSE) |
62 | | -endif() |
63 | | - |
64 | | -if(ICEBERG_BUILD_REST_INTEGRATION_TESTS AND WIN32) |
65 | | - set(ICEBERG_BUILD_REST_INTEGRATION_TESTS OFF) |
66 | | - message(WARNING "Cannot build rest integration test on Windows, turning it off.") |
67 | | -endif() |
68 | | - |
69 | | -include(CMakeParseArguments) |
70 | | -include(IcebergBuildUtils) |
71 | | -include(IcebergSanitizer) |
72 | | -include(IcebergSccache) |
73 | | -include(IcebergThirdpartyToolchain) |
74 | | - |
75 | | -if(ICEBERG_BUILD_TESTS) |
76 | | - enable_testing() |
| 4 | +if(ICEBERG_ENABLE_ARROW_S3) |
| 5 | + # Define a compile-time macro so source can conditionally include Arrow S3 headers. |
| 6 | + add_compile_definitions(HAVE_ARROW_S3) |
77 | 7 | endif() |
78 | 8 |
|
79 | | -add_subdirectory(src) |
80 | | -install(FILES LICENSE NOTICE DESTINATION ${ICEBERG_INSTALL_DOCDIR}) |
| 9 | +# Note: For robustness, consider testing whether the installed Arrow |
| 10 | +# library actually provides s3fs.h rather than relying solely on this option. |
0 commit comments