view seobeo/BUILD @ 79:5710108c949e

[Seobeo] Added Redirect logic.
author June Park <parkjune1995@gmail.com>
date Thu, 01 Jan 2026 05:57:03 -0800
parents 4532ce6d9eb8
children 70401cf61e97
line wrap: on
line source

load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_cc//cc:cc_test.bzl", "cc_test")


filegroup(
  name = "seobeo_hdrs",
  srcs = [
    "seobeo.h",
    "seobeo_internal.h",
    "snapshot_creator.h",
  ],
  visibility = ["//visibility:public"],
)

# Server-only target (no SSL, no OpenSSL dependency)
alias(
  name = "seobeo_server",
  actual = select({
    "//config:macos":  ":seobeo_server_macos",
    "//config:linux":  ":seobeo_server_linux",
    "//conditions:default": ":seobeo_server_linux",
  }),
  visibility = ["//visibility:public"],
)

cc_library(
  name = "seobeo_server_macos",
  srcs = [
    "s_linux_network.c",
    "s_web.c",
    "s_ssl.c",
    "s_router.c",
    "os/s_macos_edge.c",
  ],
  hdrs = [":seobeo_hdrs"],
  deps = [
    "//dowa:dowa",
  ],
  defines = ["SEOBEO_NO_SSL"],
  target_compatible_with = [
    "@platforms//os:osx",
  ],
  visibility = ["//visibility:public"],
)

cc_library(
  name = "seobeo_server_linux",
  srcs = [
    "s_linux_network.c",
    "s_web.c",
    "s_ssl.c",
    "s_router.c",
    "os/s_linux_edge.c",
  ],
  hdrs = [":seobeo_hdrs"],
  deps = [
    "//dowa:dowa",
  ],
  defines = ["SEOBEO_NO_SSL"],
  target_compatible_with = [
    "@platforms//os:linux",
  ],
  visibility = ["//visibility:public"],
)

# Client target with SSL support (full functionality)
alias(
  name = "seobeo_client",
  actual = select({
    "//config:macos":  ":seobeo_client_macos",
    "//config:linux":  ":seobeo_client_linux",
    "//conditions:default": ":seobeo_client_linux",
  }),
  visibility = ["//visibility:public"],
)

cc_library(
  name = "seobeo_client_macos",
  srcs = [
    "s_linux_network.c",
    "s_web.c",
    "s_ssl.c",
    "s_router.c",
    "snapshot_creator.c",
    "os/s_macos_edge.c",
  ],
  hdrs = [":seobeo_hdrs"],
  deps = [
    "//dowa:dowa",
    "@openssl//:ssl",
  ],
  target_compatible_with = [
    "@platforms//os:osx",
  ],
  visibility = ["//visibility:public"],
)

cc_library(
  name = "seobeo_client_linux",
  srcs = [
    "s_linux_network.c",
    "s_web.c",
    "s_ssl.c",
    "s_router.c",
    "snapshot_creator.c",
    "os/s_linux_edge.c",
  ],
  hdrs = [":seobeo_hdrs"],
  deps = [
    "//dowa:dowa",
    "@openssl//:ssl",
  ],
  target_compatible_with = [
    "@platforms//os:linux",
  ],
  visibility = ["//visibility:public"],
)

# Default target for backward compatibility (points to client with SSL)
alias(
  name = "seobeo",
  actual = ":seobeo_client",
  visibility = ["//visibility:public"],
)

# Tests
cc_test(
  name = "seobeo_http_client_test",
  srcs = ["seobeo_http_client_test.c"],
  deps = [":seobeo_client"],
  size = "small",
  timeout = "short",
)