From f45b37250c920b03a1a698add8c82e251c659894 Mon Sep 17 00:00:00 2001 From: wwieclaw Date: Mon, 3 Apr 2023 13:37:11 +0200 Subject: [PATCH] Build check natively in bazel --- WORKSPACE.bazel | 10 ++++++++-- c/BUILD.bazel | 12 ++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index 92605d559..51506dd32 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -4,8 +4,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "rules_swiftnav", - strip_prefix = "rules_swiftnav-82e89313fc0c2046a2b19d4a4da5167a88f5da3f", - url = "https://github.com/swift-nav/rules_swiftnav/archive/82e89313fc0c2046a2b19d4a4da5167a88f5da3f.tar.gz", + strip_prefix = "rules_swiftnav-9a47006cf0f0ea3fa65773957e737b5e7812cd8d", + url = "https://github.com/swift-nav/rules_swiftnav/archive/9a47006cf0f0ea3fa65773957e737b5e7812cd8d.tar.gz", ) http_archive( @@ -41,3 +41,9 @@ new_local_repository( build_file = "@rules_swiftnav//third_party:check.BUILD", path = "c/third_party/check", ) + +new_local_repository( + name = "check-cmake", + build_file = "@rules_swiftnav//third_party:check-cmake.BUILD", + path = "c/third_party/check", +) diff --git a/c/BUILD.bazel b/c/BUILD.bazel index def199a26..744794cf3 100644 --- a/c/BUILD.bazel +++ b/c/BUILD.bazel @@ -77,8 +77,10 @@ swift_cc_test( type = UNIT, deps = [ ":sbp", - "@check", - ], + ] + select({ + "@bazel_tools//src/conditions:darwin": ["@check-cmake//:check"], + "//conditions:default": ["@check"], + }), ) SBP_V4_C_SOURCES = glob(["test/auto*.c"]) @@ -96,8 +98,10 @@ swift_cc_test( type = UNIT, deps = [ ":sbp", - "@check", - ], + ] + select({ + "@bazel_tools//src/conditions:darwin": ["@check-cmake//:check"], + "//conditions:default": ["@check"], + }), ) SBP_CPP_V4_C_SOURCES = glob(["test/cpp/auto*.cc"])