Skip to content

Commit

Permalink
Move all deps to MODULE.bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
s-perron committed May 27, 2024
1 parent 1c9bc3f commit 0d0a4ee
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 40 deletions.
26 changes: 13 additions & 13 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ py_binary(

genrule(
name = "generators_inc",
srcs = ["@spirv_headers//:spirv_xml_registry"],
srcs = ["@spirv-headers//:spirv_xml_registry"],
outs = ["generators.inc"],
cmd = "$(location :generate_registry_tables) --xml=$(location @spirv_headers//:spirv_xml_registry) --generator-output=$(location generators.inc)",
cmd_bat = "$(location :generate_registry_tables) --xml=$(location @spirv_headers//:spirv_xml_registry) --generator-output=$(location generators.inc)",
cmd = "$(location :generate_registry_tables) --xml=$(location @spirv-headers//:spirv_xml_registry) --generator-output=$(location generators.inc)",
cmd_bat = "$(location :generate_registry_tables) --xml=$(location @spirv-headers//:spirv_xml_registry) --generator-output=$(location generators.inc)",
tools = [":generate_registry_tables"],
)

Expand Down Expand Up @@ -171,8 +171,8 @@ cc_library(
copts = COMMON_COPTS,
includes = ["include"],
deps = [
"@spirv_headers//:spirv_common_headers",
"@spirv_headers//:spirv_cpp11_headers",
"@spirv-headers//:spirv_common_headers",
"@spirv-headers//:spirv_cpp11_headers",
],
)

Expand Down Expand Up @@ -203,7 +203,7 @@ cc_library(
copts = COMMON_COPTS,
deps = [
":spirv_tools_internal",
"@spirv_headers//:spirv_common_headers",
"@spirv-headers//:spirv_common_headers",
],
)

Expand Down Expand Up @@ -319,7 +319,7 @@ cc_binary(
":spirv_tools_opt_internal",
":tools_io",
":tools_util",
"@spirv_headers//:spirv_cpp_headers",
"@spirv-headers//:spirv_cpp_headers",
],
)

Expand Down Expand Up @@ -472,7 +472,7 @@ cc_test(
":spirv_tools_opt_internal",
"@googletest//:gtest",
"@googletest//:gtest_main",
"@spirv_headers//:spirv_cpp11_headers",
"@spirv-headers//:spirv_cpp11_headers",
],
)

Expand All @@ -498,8 +498,8 @@ cc_library(
":spirv_tools_internal",
":spirv_tools_link",
":test_lib",
"@com_google_effcee//:effcee",
"@com_googlesource_code_re2//:re2",
"@effcee//:effcee",
"@re2//:re2",
],
)

Expand Down Expand Up @@ -552,7 +552,7 @@ cc_library(
deps = [
":spirv_tools_internal",
":spirv_tools_opt_internal",
"@com_google_effcee//:effcee",
"@effcee//:effcee",
"@googletest//:gtest",
],
)
Expand All @@ -568,7 +568,7 @@ cc_library(
":spirv_tools_internal",
":spirv_tools_opt_internal",
":test_lib",
"@com_google_effcee//:effcee",
"@effcee//:effcee",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
Expand Down Expand Up @@ -601,7 +601,7 @@ cc_library(
":opt_test_lib",
":spirv_tools",
":spirv_tools_opt_internal",
"@com_google_effcee//:effcee",
"@effcee//:effcee",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
Expand Down
24 changes: 24 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
bazel_dep(name = "bazel_skylib", version = "1.5.0")

bazel_dep(name = "abseil-cpp", dev_dependency = True)
local_path_override(
module_name = "abseil-cpp",
path = "external/abseil_cpp",
)

bazel_dep(name = "re2", dev_dependency = True)
local_path_override(
module_name = "re2",
path = "external/re2",
)

bazel_dep(name = "googletest", dev_dependency = True)
local_path_override(
module_name = "googletest",
path = "external/googletest",
)

bazel_dep(name = "effcee", dev_dependency = True)
local_path_override(
module_name = "effcee",
path = "external/effcee",
)

bazel_dep(name = "spirv-headers", dev_dependency = False)
local_path_override(
module_name = "spirv-headers",
path = "external/spirv-headers",
)
19 changes: 0 additions & 19 deletions WORKSPACE

This file was deleted.

16 changes: 8 additions & 8 deletions build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def incompatible_with(incompatible_constraints):
for constraint in incompatible_constraints
}]))

DEBUGINFO_GRAMMAR_JSON_FILE = "@spirv_headers//:spirv_ext_inst_debuginfo_grammar_unified1"
CLDEBUGINFO100_GRAMMAR_JSON_FILE = "@spirv_headers//:spirv_ext_inst_opencl_debuginfo_100_grammar_unified1"
SHDEBUGINFO100_GRAMMAR_JSON_FILE = "@spirv_headers//:spirv_ext_inst_nonsemantic_shader_debuginfo_100_grammar_unified1"
DEBUGINFO_GRAMMAR_JSON_FILE = "@spirv-headers//:spirv_ext_inst_debuginfo_grammar_unified1"
CLDEBUGINFO100_GRAMMAR_JSON_FILE = "@spirv-headers//:spirv_ext_inst_opencl_debuginfo_100_grammar_unified1"
SHDEBUGINFO100_GRAMMAR_JSON_FILE = "@spirv-headers//:spirv_ext_inst_nonsemantic_shader_debuginfo_100_grammar_unified1"

def _merge_dicts(dicts):
merged = {}
Expand All @@ -62,7 +62,7 @@ def generate_core_tables(version):
fail("Must specify version", "version")

grammars = dict(
core_grammar = "@spirv_headers//:spirv_core_grammar_{}".format(version),
core_grammar = "@spirv-headers//:spirv_core_grammar_{}".format(version),
debuginfo_grammar = DEBUGINFO_GRAMMAR_JSON_FILE,
cldebuginfo_grammar = CLDEBUGINFO100_GRAMMAR_JSON_FILE,
)
Expand Down Expand Up @@ -97,7 +97,7 @@ def generate_enum_string_mapping(version):
fail("Must specify version", "version")

grammars = dict(
core_grammar = "@spirv_headers//:spirv_core_grammar_{}".format(version),
core_grammar = "@spirv-headers//:spirv_core_grammar_{}".format(version),
debuginfo_grammar = DEBUGINFO_GRAMMAR_JSON_FILE,
cldebuginfo_grammar = CLDEBUGINFO100_GRAMMAR_JSON_FILE,
)
Expand Down Expand Up @@ -132,7 +132,7 @@ def generate_opencl_tables(version):
fail("Must specify version", "version")

grammars = dict(
opencl_grammar = "@spirv_headers//:spirv_opencl_grammar_{}".format(version),
opencl_grammar = "@spirv-headers//:spirv_opencl_grammar_{}".format(version),
)

outs = dict(
Expand Down Expand Up @@ -160,7 +160,7 @@ def generate_glsl_tables(version):
fail("Must specify version", "version")

grammars = dict(
gsls_grammar = "@spirv_headers//:spirv_glsl_grammar_{}".format(version),
gsls_grammar = "@spirv-headers//:spirv_glsl_grammar_{}".format(version),
)
outs = dict(
gsls_insts_outs = "glsl.std.450.insts.inc",
Expand Down Expand Up @@ -189,7 +189,7 @@ def generate_vendor_tables(extension, operand_kind_prefix = ""):

extension_rule = extension.replace("-", "_").replace(".", "_")
grammars = dict(
vendor_grammar = "@spirv_headers//:spirv_ext_inst_{}_grammar_unified1".format(extension_rule),
vendor_grammar = "@spirv-headers//:spirv_ext_inst_{}_grammar_unified1".format(extension_rule),
)
outs = dict(
vendor_insts_output = "{}.insts.inc".format(extension),
Expand Down

0 comments on commit 0d0a4ee

Please sign in to comment.