# This BUILD file is a translation of the various CMakeLists.txt in the # original source. load("@rules_cc//cc:defs.bzl", "cc_library") load("@rules_license//rules:license.bzl", "license") load("//:compiler_select.bzl", "compiler_select") package(default_applicable_licenses = [":license"]) license( name = "license", package_name = "AWS SDK for C++", license_kinds = ["@rules_license//licenses/spdx:Apache-2.0"], license_text = "LICENSE.txt", package_version = "1.11.758", ) common_copts = [ "-DPLATFORM_LINUX", "-DINTEL_NO_ITTNOTIFY_API", "-Wno-cast-align", "-Wno-cast-qual", ] cc_library( name = "s3", srcs = glob(["generated/src/aws-cpp-sdk-s3/source/**/*.cpp"]), hdrs = glob(["generated/src/aws-cpp-sdk-s3/include/**/*.h"]), copts = common_copts, includes = ["generated/src/aws-cpp-sdk-s3/include"], target_compatible_with = ["@platforms//os:linux"], visibility = ["//visibility:public"], deps = [ ":aws-c-auth", ":core", ], ) cc_library( name = "sts", srcs = glob(["generated/src/aws-cpp-sdk-sts/source/**/*.cpp"]), hdrs = glob(["generated/src/aws-cpp-sdk-sts/include/**/*.h"]), copts = common_copts, includes = ["generated/src/aws-cpp-sdk-sts/include"], target_compatible_with = ["@platforms//os:linux"], visibility = ["//visibility:public"], deps = [ ":aws-c-auth", ":core", ], ) cc_library( name = "transfer", srcs = glob(["src/aws-cpp-sdk-transfer/source/**/*.cpp"]), hdrs = glob(["src/aws-cpp-sdk-transfer/include/**/*.h"]), copts = common_copts, includes = ["src/aws-cpp-sdk-transfer/include"], target_compatible_with = ["@platforms//os:linux"], visibility = ["//visibility:public"], deps = [ ":core", ":s3", ], ) genrule( name = "gen_SDKConfig", outs = ["src/aws-cpp-sdk-core/include/aws/core/SDKConfig.h"], cmd = "echo '#undef USE_AWS_MEMORY_MANAGEMENT' > $@", target_compatible_with = ["@platforms//os:linux"], ) cc_library( name = "core", srcs = glob( include = ["src/aws-cpp-sdk-core/source/**/*.cpp"], exclude = [ "src/aws-cpp-sdk-core/source/utils/crypto/*/*.cpp", "src/aws-cpp-sdk-core/source/platform/**/*.cpp", "src/aws-cpp-sdk-core/source/platform/windows/**/*.cpp", # net/*.cpp is for not-(linux or windows), so exclude everything in there. "src/aws-cpp-sdk-core/source/net/**/*.cpp", "src/aws-cpp-sdk-core/source/http/windows/**/*.cpp", ], ) + glob([ "src/aws-cpp-sdk-core/source/utils/crypto/crt/*.cpp", "src/aws-cpp-sdk-core/source/utils/crypto/factory/*.cpp", "src/aws-cpp-sdk-core/source/platform/linux-shared/**/*.cpp", "src/aws-cpp-sdk-core/source/net/linux-shared/*.cpp", ]) + [ ":gen_SDKConfig", ], hdrs = glob( include = ["src/aws-cpp-sdk-core/include/**/*.h"], exclude = [ "src/aws-cpp-sdk-core/include/aws/core/utils/crypto/*/*.h", "src/aws-cpp-sdk-core/include/aws/core/http/windows/**/*.h", ], ) + glob([ "src/aws-cpp-sdk-core/include/aws/core/utils/crypto/crt/*.h", ]), copts = common_copts + [ "-DAWS_SDK_VERSION_MAJOR=10", "-DAWS_SDK_VERSION_MINOR=34", "-DAWS_SDK_VERSION_PATCH=\"\\\"BCR\"\\\"", "-DENABLE_OPENSSL_ENCRYPTION", "-DENABLE_CURL_CLIENT", "-Wno-format-nonliteral", ], includes = ["src/aws-cpp-sdk-core/include"], target_compatible_with = ["@platforms//os:linux"], visibility = ["//visibility:public"], deps = [ ":aws-c-auth", ":aws-c-common", ":aws-c-http", ":crt", "@boringssl//:crypto", "@curl", "@opentelemetry-cpp//api", "@opentelemetry-cpp//exporters/ostream:ostream_metric_exporter", "@opentelemetry-cpp//exporters/ostream:ostream_span_exporter", "@opentelemetry-cpp//sdk:headers", ], ) genrule( name = "gen_Config", outs = ["crt/aws-crt-cpp/include/aws/crt/Config.h"], cmd = "; ".join([ "echo '#define AWS_CRT_CPP_VERSION \"1.11.758\"' > $@", "echo '#define AWS_CRT_CPP_VERSION_MAJOR 1' >> $@", "echo '#define AWS_CRT_CPP_VERSION_MINOR 11' >> $@", "echo '#define AWS_CRT_CPP_VERSION_PATCH 758' >> $@", ]), target_compatible_with = ["@platforms//os:linux"], ) cc_library( name = "crt", srcs = glob(["crt/aws-crt-cpp/source/**/*.cpp"]), hdrs = glob(["crt/aws-crt-cpp/include/**/*.h"]) + [ ":gen_Config", ], copts = common_copts + [ "-Wno-sign-compare", "-Wno-tautological-type-limit-compare", "-Wno-missing-field-initializers", ], includes = ["crt/aws-crt-cpp/include"], target_compatible_with = ["@platforms//os:linux"], visibility = ["//visibility:public"], deps = [ ":aws-c-auth", ":aws-c-common", ":aws-c-event-stream", ":aws-c-mqtt", ":aws-c-s3", ":aws-c-sdkutils", ], ) genrule( name = "gen_config", outs = ["crt/aws-crt-cpp/crt/aws-c-common/include/aws/common/config.h"], cmd = "\n".join([ "cat >$@ <