Remove matcha from WORKSPACE, tweak dual_cc_library
- Having matcha imported into the workspace was causing circular
dependencies to surface in Verilator builds.
- To allow removing matcha from the workspace, reverse the way the
select works in dual_cc_library: If the platform matches host, use the
host library. Anything else is assumed to be a device platform.
Change-Id: I623b99509c78d6f9343bf26eadd84e0be342064f
diff --git a/WORKSPACE b/WORKSPACE
index e0a9784..9eb984c 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -7,14 +7,6 @@
workspace(name = "lowrisc_opentitan")
-# We import this into the workspace to pick up a Bazel platform rule.
-# Be careful about importing anything else from here, it's not likely
-# to actually be something you want to do.
-local_repository(
- name = "matcha",
- path = "../matcha",
-)
-
# CRT is the Compiler Repository Toolkit. It contains the configuration for
# the windows compiler.
load("//third_party/crt:repos.bzl", "crt_repos")
diff --git a/rules/BUILD b/rules/BUILD
index ca0e934..40059e4 100644
--- a/rules/BUILD
+++ b/rules/BUILD
@@ -10,3 +10,8 @@
name = "opentitan_platform",
values = {"platforms": OPENTITAN_PLATFORM},
)
+
+config_setting(
+ name = "host_platform",
+ values = {"platforms":"@local_config_platform//:host"},
+)
diff --git a/rules/cross_platform.bzl b/rules/cross_platform.bzl
index 2193e70..9075b27 100644
--- a/rules/cross_platform.bzl
+++ b/rules/cross_platform.bzl
@@ -88,8 +88,7 @@
native.alias(
name = name,
actual = select({
- on_device_config_setting: dual_cc_device_library_of(name),
- "@matcha//rules:sparrow_platform": dual_cc_device_library_of(name),
- "//conditions:default": off_device_name,
+ "//rules:host_platform": off_device_name,
+ "//conditions:default": dual_cc_device_library_of(name),
}),
)