Debian Codegraph @

core/BUILD

raw
1 load("@rules_cc//cc:cc_library.bzl", "cc_library")
2 load("@rules_cc//cc:cc_test.bzl", "cc_test")
3
4 package(default_visibility = ["//visibility:private"])
5
6 cc_library(
7 name = "libjsonnet",
8 srcs = [
9 "ast.h",
10 "desugarer.cpp",
11 "desugarer.h",
12 "formatter.cpp",
13 "formatter.h",
14 "json.h",
15 "lexer.cpp",
16 "lexer.h",
17 "libjsonnet.cpp",
18 "parser.cpp",
19 "parser.h",
20 "pass.cpp",
21 "pass.h",
22 "path_utils.cpp",
23 "path_utils.h",
24 "state.h",
25 "static_analysis.cpp",
26 "static_analysis.h",
27 "static_error.h",
28 "string_utils.cpp",
29 "string_utils.h",
30 "unicode.h",
31 "vm.cpp",
32 "vm.h",
33 ],
34 copts = ["-I."],
35 implementation_deps = [
36 "//stdlib:std",
37 "//third_party/json",
38 "//third_party/md5:libmd5",
39 "//third_party/rapidyaml:ryml",
40 ],
41 linkopts = ["-lm"],
42 visibility = ["//visibility:public"],
43 deps = [
44 "//include:libjsonnet",
45 "//include:libjsonnet_fmt",
46 ],
47 )
48
49 cc_test(
50 name = "lexer_test",
51 srcs = ["lexer_test.cpp"],
52 deps = [
53 ":libjsonnet",
54 # Note: On Ubuntu, apt-get install libgtest-dev google-mock
55 "@googletest//:gtest_main",
56 ],
57 )
58
59 cc_test(
60 name = "parser_test",
61 srcs = ["parser_test.cpp"],
62 deps = [
63 ":libjsonnet",
64 "@googletest//:gtest_main",
65 ],
66 )
67
68 cc_test(
69 name = "libjsonnet_test",
70 srcs = ["libjsonnet_test.cpp"],
71 data = ["//test_suite:test_input_for_core_test"],
72 deps = [
73 ":libjsonnet",
74 "@googletest//:gtest_main",
75 ],
76 )
77
78 cc_test(
79 name = "unicode_test",
80 srcs = ["unicode_test.cpp"],
81 deps = [
82 ":libjsonnet",
83 "@googletest//:gtest_main",
84 ],
85 )
86
87 cc_test(
88 name = "libjsonnet_native_callbacks_test",
89 srcs = ["libjsonnet_native_callbacks_test.c"],
90 deps = [":libjsonnet"],
91 )
92
93 cc_test(
94 name = "libjsonnet_file_test",
95 srcs = ["libjsonnet_file_test.c"],
96 args = ["$(rootpath //test_suite:test_input_for_core_test)"],
97 data = ["//test_suite:test_input_for_core_test"],
98 deps = [":libjsonnet"],
99 )