diff --git a/bazel/envoy_build_system.bzl b/bazel/envoy_build_system.bzl index 482b0d7cd85b..2de6f7f11301 100644 --- a/bazel/envoy_build_system.bzl +++ b/bazel/envoy_build_system.bzl @@ -164,6 +164,7 @@ def envoy_cc_binary(name, data = [], testonly = 0, visibility = None, + external_deps = [], repository = "", stamped = False, deps = [], @@ -172,6 +173,7 @@ def envoy_cc_binary(name, if stamped: _git_stamped_genrule(repository, name) _git_stamped_genrule(repository, name + ".stripped") + deps = deps + [envoy_external_dep_path(dep) for dep in external_deps] native.cc_binary( name = name, srcs = srcs, diff --git a/bazel/external/BUILD b/bazel/external/BUILD index 82c3d20c8f25..63a81dd5e12b 100644 --- a/bazel/external/BUILD +++ b/bazel/external/BUILD @@ -4,9 +4,9 @@ cc_library( name = "all_external", srcs = [":empty.cc"], deps = [ - "@io_opentracing_cpp//:opentracing", - "@com_lightstep_tracer_cpp//:lightstep_tracer", "@com_google_googletest//:gtest", + "@com_lightstep_tracer_cpp//:lightstep_tracer", + "@io_opentracing_cpp//:opentracing", ], ) diff --git a/bazel/target_recipes.bzl b/bazel/target_recipes.bzl index 389126dc4703..0fafdd7d6b43 100644 --- a/bazel/target_recipes.bzl +++ b/bazel/target_recipes.bzl @@ -3,6 +3,7 @@ # ci/build_container/build_recipes. TARGET_RECIPES = { "ares": "cares", + "benchmark": "benchmark", "event": "libevent", "event_pthreads": "libevent", "tcmalloc_and_profiler": "gperftools", diff --git a/ci/build_container/build_recipes/benchmark.sh b/ci/build_container/build_recipes/benchmark.sh new file mode 100644 index 000000000000..5e8f2f41ab2c --- /dev/null +++ b/ci/build_container/build_recipes/benchmark.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -e +export COMMIT="e1c3a83b8197cf02e794f61228461c27d4e78cfb" # benchmark @ Jan 11, 2018 + +git clone https://github.com/google/benchmark.git +(cd benchmark; git reset --hard "$COMMIT") +mkdir build + +cd build +cmake -G "Unix Makefiles" ../benchmark \ + -DCMAKE_BUILD_TYPE=RELEASE \ + -DBENCHMARK_ENABLE_GTEST_TESTS=OFF +make +cp src/libbenchmark.a "$THIRDPARTY_BUILD"/lib +cd ../benchmark + +INCLUDE_DIR="$THIRDPARTY_BUILD/include/testing/base/public" +mkdir -p "$INCLUDE_DIR" +cp include/benchmark/benchmark.h "$INCLUDE_DIR" diff --git a/ci/prebuilt/BUILD b/ci/prebuilt/BUILD index 1cfbb9d51985..e65c5db41683 100644 --- a/ci/prebuilt/BUILD +++ b/ci/prebuilt/BUILD @@ -9,6 +9,13 @@ cc_library( includes = ["thirdparty_build/include"], ) +cc_library( + name = "benchmark", + srcs = ["thirdparty_build/lib/libbenchmark.a"], + hdrs = ["thirdparty_build/include/testing/base/public/benchmark.h"], + includes = ["thirdparty_build/include"], +) + cc_library( name = "crypto", srcs = ["thirdparty_build/lib/libcrypto.a"],