|
| 1 | +# Description: |
| 2 | +# AWS C Cal |
| 3 | +load("@rules_cc//cc:cc_library.bzl", "cc_library") |
| 4 | + |
| 5 | +load("@bazel_skylib//rules:build_test.bzl", "build_test") |
| 6 | + |
| 7 | +package(default_visibility = ["//visibility:public"]) |
| 8 | + |
| 9 | +licenses(["notice"]) # Apache 2.0 |
| 10 | + |
| 11 | +cc_library( |
| 12 | + name = "aws-c-cal", |
| 13 | + srcs = glob([ |
| 14 | + "source/*.c", |
| 15 | + "source/shared/ed25519.c", |
| 16 | + "source/shared/lccrypto_common.c", |
| 17 | + "source/shared/ref_hkdf.c", |
| 18 | + ]) + select({ |
| 19 | + "@platforms//os:windows": glob([ |
| 20 | + "source/windows/*.c", |
| 21 | + ]), |
| 22 | + "@platforms//os:linux": glob([ |
| 23 | + "source/unix/*.c", |
| 24 | + ]), |
| 25 | + "@platforms//os:osx": glob([ |
| 26 | + "source/darwin/*.c", |
| 27 | + "source/darwin/*.h", |
| 28 | + ]), |
| 29 | + }), |
| 30 | + hdrs = glob([ |
| 31 | + "include/aws/cal/*.h", |
| 32 | + "include/aws/cal/private/*.h", |
| 33 | + ]), |
| 34 | + includes = ["include"], |
| 35 | + linkopts = select({ |
| 36 | + "@platforms//os:windows": [ |
| 37 | + "-DEFAULTLIB:bcrypt.lib", |
| 38 | + ], |
| 39 | + "@platforms//os:macos": [ |
| 40 | + "-framework CoreFoundation", |
| 41 | + "-framework Security", |
| 42 | + ], |
| 43 | + "//conditions:default": [], |
| 44 | + }) + select({ |
| 45 | + "@rules_cc//cc/compiler:mingw-gcc": [ |
| 46 | + "-lbcrypt", |
| 47 | + ], |
| 48 | + "//conditions:default": [], |
| 49 | + }), |
| 50 | + deps = [ |
| 51 | + ":darwin_headers", |
| 52 | + "@aws-c-common", |
| 53 | + "@boringssl//:crypto", |
| 54 | + ], |
| 55 | +) |
| 56 | + |
| 57 | +cc_library( |
| 58 | + name = "darwin_headers", |
| 59 | + hdrs = glob([ |
| 60 | + "source/darwin/**/*.h", |
| 61 | + ]), |
| 62 | + strip_include_prefix = "source/darwin", |
| 63 | + visibility = ["//visibility:private"], |
| 64 | +) |
| 65 | + |
| 66 | +build_test( |
| 67 | + name = "build_test", |
| 68 | + targets = [ |
| 69 | + ":aws-c-cal", |
| 70 | + ], |
| 71 | +) |
0 commit comments