2022-03-23 05:26:25 +00:00
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
|
2022-03-22 23:04:29 +00:00
|
|
|
load("//bazel:copts.bzl", "COPTS")
|
|
|
|
|
2022-03-22 22:43:47 +00:00
|
|
|
genrule(
|
|
|
|
name = "data",
|
|
|
|
srcs = [
|
|
|
|
"//charmap:data",
|
|
|
|
"//scripts:data",
|
|
|
|
],
|
|
|
|
outs = [
|
2022-03-25 02:34:32 +00:00
|
|
|
"charmap_data.c",
|
|
|
|
"charmap_info.c",
|
|
|
|
"charmap_region.c",
|
2022-03-22 22:43:47 +00:00
|
|
|
"charmap.r",
|
2022-03-25 02:34:32 +00:00
|
|
|
],
|
|
|
|
cmd = "$(execpath //gen:macscript) -dest=$(RULEDIR) -src=. -quiet -format=false",
|
2022-03-22 22:43:47 +00:00
|
|
|
tools = [
|
|
|
|
"//gen:macscript",
|
|
|
|
],
|
|
|
|
)
|
2022-03-22 23:04:29 +00:00
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "convert",
|
|
|
|
srcs = [
|
2022-03-25 02:34:32 +00:00
|
|
|
"charmap_data.c",
|
|
|
|
"charmap_info.c",
|
|
|
|
"charmap_region.c",
|
2022-03-23 05:26:25 +00:00
|
|
|
"convert.c",
|
|
|
|
"convert_1f.c",
|
|
|
|
"convert_1r.c",
|
2022-03-25 02:34:32 +00:00
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"convert.h",
|
|
|
|
"data.h",
|
2022-03-22 23:04:29 +00:00
|
|
|
],
|
|
|
|
copts = COPTS,
|
2022-03-25 05:45:55 +00:00
|
|
|
deps = [
|
|
|
|
"//lib",
|
|
|
|
],
|
2022-03-22 23:04:29 +00:00
|
|
|
)
|
2022-03-23 05:26:25 +00:00
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "convert_test",
|
2022-03-30 09:18:21 +00:00
|
|
|
size = "small",
|
2022-03-23 05:26:25 +00:00
|
|
|
srcs = [
|
|
|
|
"convert_test.c",
|
|
|
|
],
|
|
|
|
copts = COPTS,
|
|
|
|
deps = [
|
|
|
|
":convert",
|
2022-03-25 05:45:55 +00:00
|
|
|
"//lib",
|
2022-03-30 07:46:19 +00:00
|
|
|
"//lib:test",
|
2022-03-23 05:26:25 +00:00
|
|
|
],
|
|
|
|
)
|