github.com/prysmaticlabs/prysm@v1.4.4/third_party/blst/blst.BUILD (about) 1 load("@prysm//tools/go:def.bzl", "go_library") 2 load("@io_bazel_rules_go//go:def.bzl", "go_test") 3 4 go_library( 5 name = "go_default_library", 6 srcs = [ 7 "bindings/go/blst.go", 8 "bindings/go/server.c", 9 ], 10 cgo = True, 11 copts = [ 12 "-D__BLST_CGO__", 13 "-Ibindings", 14 "-Isrc", 15 "-D__BLST_PORTABLE__", 16 "-O", 17 ] + select({ 18 "@io_bazel_rules_go//go/platform:amd64": [ 19 "-mno-avx", 20 "-D__ADX__", 21 ], 22 "//conditions:default": [], 23 }), 24 cdeps = [":blst"], 25 importpath = "github.com/supranational/blst/bindings/go", 26 visibility = ["//visibility:public"], 27 ) 28 29 go_test( 30 name = "go_default_test", 31 srcs = [ 32 "bindings/go/blst_htoc_test.go", 33 "bindings/go/blst_minpk_test.go", 34 "bindings/go/blst_minsig_test.go", 35 ], 36 embed = [":go_default_library"], 37 data = glob([ 38 "bindings/go/hash_to_curve/*.json", 39 ]), 40 ) 41 42 cc_library( 43 name = "blst", 44 srcs = [ 45 "bindings/blst.h", 46 "bindings/blst_aux.h", 47 ], 48 hdrs = [ 49 "bindings/blst.h", 50 "bindings/blst_aux.h", 51 ], 52 deps = [ 53 ":src", 54 ":asm", 55 ], 56 strip_include_prefix = "bindings", 57 visibility = ["//visibility:public"], 58 ) 59 60 cc_library( 61 name = "asm_hdrs", 62 hdrs = glob([ 63 "build/**/*.s", 64 "build/**/*.S", 65 ], exclude = ["build/assembly.s"]), 66 ) 67 68 cc_library( 69 name = "asm", 70 srcs = [ 71 "build/assembly.S", 72 ], 73 copts = [ 74 "-D__BLST_PORTABLE__", 75 "-O", 76 ] + select({ 77 "@io_bazel_rules_go//go/platform:amd64": [ 78 "-mno-avx", 79 "-D__ADX__", 80 ], 81 "//conditions:default": [], 82 }), 83 deps = [":asm_hdrs"], 84 linkstatic = True, 85 ) 86 87 cc_library( 88 name = "hdrs", 89 hdrs = glob( 90 [ 91 "src/*.c", 92 "src/*.h", 93 ], 94 exclude = [ 95 "src/server.c", 96 "src/client_*.c", 97 ], 98 ), 99 strip_include_prefix = "src", 100 ) 101 102 cc_library( 103 name = "src", 104 srcs = [ 105 "src/server.c", 106 ], 107 deps = [ 108 ":hdrs", 109 ], 110 )