comparison seobeo/BUILD @ 67:6626ec933933

[Seobeo] Separated out Client Server logic. Created test tools.
author June Park <parkjune1995@gmail.com>
date Wed, 24 Dec 2025 09:15:55 -0800
parents 08a465eec50b
children 4532ce6d9eb8
comparison
equal deleted inserted replaced
66:a0f0ad5e42eb 67:6626ec933933
1 load("@rules_cc//cc:cc_binary.bzl", "cc_binary") 1 load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
2 load("@rules_cc//cc:cc_library.bzl", "cc_library") 2 load("@rules_cc//cc:cc_library.bzl", "cc_library")
3 load("@rules_cc//cc:cc_test.bzl", "cc_test")
3 4
4 5
5 filegroup( 6 filegroup(
6 name = "seobeo_hdrs", 7 name = "seobeo_hdrs",
7 srcs = [ 8 srcs = [
8 "seobeo.h", 9 "seobeo.h",
9 "seobeo_internal.h", 10 "seobeo_internal.h",
11 "snapshot_creator.h",
10 ], 12 ],
11 visibility = ["//visibility:public"], 13 visibility = ["//visibility:public"],
12 ) 14 )
13 15
16 # Server-only target (no SSL, no OpenSSL dependency)
14 alias( 17 alias(
15 name = "seobeo", 18 name = "seobeo_server",
16 actual = select({ 19 actual = select({
17 "//config:macos": ":seobeo_macos", 20 "//config:macos": ":seobeo_server_macos",
18 "//config:linux": ":seobeo_linux", 21 "//config:linux": ":seobeo_server_linux",
19 "//conditions:default": ":seobeo_linux", 22 "//conditions:default": ":seobeo_server_linux",
20 }), 23 }),
21 visibility = ["//visibility:public"], 24 visibility = ["//visibility:public"],
22 ) 25 )
23 26
24 cc_library( 27 cc_library(
25 name = "seobeo_macos", 28 name = "seobeo_server_macos",
26 srcs = [ 29 srcs = [
27 "s_linux_network.c", 30 "s_linux_network.c",
28 "s_web.c", 31 "s_web.c",
32 "s_ssl.c",
33 "os/s_macos_edge.c",
34 ],
35 hdrs = [":seobeo_hdrs"],
36 deps = [
37 "//dowa:dowa",
38 ],
39 defines = ["SEOBEO_NO_SSL"],
40 target_compatible_with = [
41 "@platforms//os:osx",
42 ],
43 visibility = ["//visibility:public"],
44 )
45
46 cc_library(
47 name = "seobeo_server_linux",
48 srcs = [
49 "s_linux_network.c",
50 "s_web.c",
51 "s_ssl.c",
52 "os/s_linux_edge.c",
53 ],
54 hdrs = [":seobeo_hdrs"],
55 deps = [
56 "//dowa:dowa",
57 ],
58 defines = ["SEOBEO_NO_SSL"],
59 target_compatible_with = [
60 "@platforms//os:linux",
61 ],
62 visibility = ["//visibility:public"],
63 )
64
65 # Client target with SSL support (full functionality)
66 alias(
67 name = "seobeo_client",
68 actual = select({
69 "//config:macos": ":seobeo_client_macos",
70 "//config:linux": ":seobeo_client_linux",
71 "//conditions:default": ":seobeo_client_linux",
72 }),
73 visibility = ["//visibility:public"],
74 )
75
76 cc_library(
77 name = "seobeo_client_macos",
78 srcs = [
79 "s_linux_network.c",
80 "s_web.c",
81 "s_ssl.c",
82 "snapshot_creator.c",
29 "os/s_macos_edge.c", 83 "os/s_macos_edge.c",
30 ], 84 ],
31 hdrs = [":seobeo_hdrs"], 85 hdrs = [":seobeo_hdrs"],
32 deps = [ 86 deps = [
33 "//dowa:dowa", 87 "//dowa:dowa",
38 ], 92 ],
39 visibility = ["//visibility:public"], 93 visibility = ["//visibility:public"],
40 ) 94 )
41 95
42 cc_library( 96 cc_library(
43 name = "seobeo_linux", 97 name = "seobeo_client_linux",
44 srcs = [ 98 srcs = [
45 "s_linux_network.c", 99 "s_linux_network.c",
46 "s_web.c", 100 "s_web.c",
101 "s_ssl.c",
102 "snapshot_creator.c",
47 "os/s_linux_edge.c", 103 "os/s_linux_edge.c",
48 ], 104 ],
49 hdrs = [":seobeo_hdrs"], 105 hdrs = [":seobeo_hdrs"],
50 deps = [ 106 deps = [
51 "//dowa:dowa", 107 "//dowa:dowa",
55 "@platforms//os:linux", 111 "@platforms//os:linux",
56 ], 112 ],
57 visibility = ["//visibility:public"], 113 visibility = ["//visibility:public"],
58 ) 114 )
59 115
116 # Default target for backward compatibility (points to client with SSL)
117 alias(
118 name = "seobeo",
119 actual = ":seobeo_client",
120 visibility = ["//visibility:public"],
121 )
122
123 # Tests
124 cc_test(
125 name = "seobeo_http_client_test",
126 srcs = ["seobeo_http_client_test.c"],
127 deps = [":seobeo_client"],
128 size = "small",
129 timeout = "short",
130 )
131