Skip to content
Open
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
25 changes: 25 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ include(cmake/third_party_absl.cmake)
include(cmake/third_party_pybind11.cmake)
include(cmake/third_party_zstd.cmake)
include(cmake/third_party_gcs.cmake)
include(cmake/third_party_aws.cmake)

# Restore original CXX_FLAGS
set(CMAKE_CXX_FLAGS "${SAVED_CMAKE_CXX_FLAGS}")
Expand Down Expand Up @@ -107,6 +108,27 @@ bagz_cc_library(
google-cloud-cpp::storage
)

file(GLOB bagz_file_system_s3_sources "src/file/file_systems/s3/*.cc")
file(GLOB bagz_file_system_s3_headers "src/file/file_systems/s3/*.h")

bagz_cc_library(
bagz_file_system_s3
SOURCES ${bagz_file_system_s3_sources}
HEADERS ${bagz_file_system_s3_headers}
DEPS
absl::log
absl::status
absl::statusor
absl::strings
bagz_file_system
bagz_internal
aws-cpp-sdk-s3
aws-cpp-sdk-core
GTest::gtest
GTest::gtest_main
GTest::gmock
)

file(GLOB bagz_file_sources "src/file/*.cc" "src/file/registry/*.cc")
file(GLOB bagz_file_headers "src/file/*.h" "src/file/registry/*.h")

Expand All @@ -123,7 +145,10 @@ bagz_cc_library(
bagz_file_system
bagz_file_system_posix
bagz_file_system_gcs
bagz_file_system_s3
google-cloud-cpp::storage
aws-cpp-sdk-s3
aws-cpp-sdk-core
)

file(GLOB bagz_core_sources "src/*.cc")
Expand Down
45 changes: 45 additions & 0 deletions cmake/third_party_aws.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 2025 Google LLC
#
# Licensed 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.

# Disable testing.
set(BUILD_TESTING OFF)
set(ENABLE_TESTING OFF)

# Only build S3 client
set(BUILD_ONLY "s3" CACHE STRING "")

# Disable shared libraries
set(BUILD_SHARED_LIBS OFF CACHE BOOL "")

FetchContent_Declare(
aws-sdk-cpp
GIT_REPOSITORY https://github.com/aws/aws-sdk-cpp.git
GIT_TAG 1.11.400 # Latest stable version
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)

FetchContent_MakeAvailable(aws-sdk-cpp)

FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.17.0
)

set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

if (NOT TARGET GTest::gtest)
FetchContent_MakeAvailable(googletest)
endif()
Loading