| 1 |
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") |
| 2 |
|
| 3 |
package(default_visibility = ["//visibility:public"]) |
| 4 |
|
| 5 |
cc_library( |
| 6 |
name = "portable_util_lib", |
| 7 |
hdrs = ["PortableUtil.hpp"], |
| 8 |
includes = ["."], |
| 9 |
) |
| 10 |
|
| 11 |
cc_test( |
| 12 |
name = "bazel_opencc_test", |
| 13 |
size = "small", |
| 14 |
srcs = [ |
| 15 |
"BazelOpenccTest.cpp", |
| 16 |
"PortableUtil.hpp", |
| 17 |
], |
| 18 |
data = [ |
| 19 |
"//data/config", |
| 20 |
"//data/dictionary:binary_dictionaries", |
| 21 |
], |
| 22 |
defines = ["BAZEL"], |
| 23 |
deps = [ |
| 24 |
"//:opencc_lib", |
| 25 |
"@bazel_tools//tools/cpp/runfiles", |
| 26 |
"@googletest//:gtest_main", |
| 27 |
], |
| 28 |
) |
| 29 |
|
| 30 |
cc_test( |
| 31 |
name = "command_line_converter_test", |
| 32 |
size = "small", |
| 33 |
srcs = [ |
| 34 |
"CommandLineConvertTest.cpp", |
| 35 |
"PortableUtil.hpp", |
| 36 |
], |
| 37 |
data = [ |
| 38 |
"//data/config", |
| 39 |
"//data/dictionary:binary_dictionaries", |
| 40 |
"//data/dictionary:text_dictionaries", |
| 41 |
"//src/tools:command_line", |
| 42 |
"//test/testcases", |
| 43 |
] + select({ |
| 44 |
"@platforms//os:windows": [], |
| 45 |
"//conditions:default": [ |
| 46 |
"//data:opencc_resources_zip", |
| 47 |
"//data:opencc_resources_ocd2_zip", |
| 48 |
], |
| 49 |
}), |
| 50 |
defines = ["BAZEL"] + select({ |
| 51 |
"@platforms//os:windows": [], |
| 52 |
"//conditions:default": ["OPENCC_ENABLE_RESOURCE_ZIP_TEST"], |
| 53 |
}), |
| 54 |
deps = [ |
| 55 |
"//src:common_lib", |
| 56 |
"@bazel_tools//tools/cpp/runfiles", |
| 57 |
"@googletest//:gtest_main", |
| 58 |
"//deps/rapidjson-1.1.0:rapidjson", |
| 59 |
], |
| 60 |
) |