view markdown_converter/BUILD @ 279:b3b547563ec7

Add Google connector service and agent wiki Implement the C/Seobeo Google Drive and Gmail connector with encrypted OAuth storage, Zenbu authentication, browser testing, AI tool discovery, chunked HTTP decoding, and Bazel coverage. Consolidate repository guidance into progressive wiki documentation and enforce arena-first allocation for new first-party C code. Co-authored-by: Copilot <[email protected]> Copilot-Session: 84c338fd-0939-4bb3-b7f3-1062eb213e5d
author MrJuneJune <me@mrjunejune.com>
date Mon, 17 Aug 2026 22:22:36 -0700
parents a2725419f988
children
line wrap: on
line source

load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
load("//gui_ze:gui_ze.bzl", "bun_run", "move_files_into_dir")
load("@emsdk//emscripten_toolchain:wasm_rules.bzl", "wasm_cc_binary")

# JS only
filegroup(
  name = "markdown_to_html",
  srcs = glob([
      "**/*.js",
  ], allow_empty=True),
  visibility = ["//visibility:public"],
)

filegroup(
  name = "markdown_to_html_hdrs",
  srcs = glob([
      "*.h",
  ], allow_empty=True),
  visibility = ["//visibility:public"],
)

# C implementation for native use (as library)
cc_library(
  name = "markdown_to_html_c",
  srcs = ["markdown_to_html.c"],
  hdrs = [":markdown_to_html_hdrs"],
  visibility = ["//visibility:public"],
)

# WASM binary target (cc_binary required for wasm_cc_binary)
# Note: linkopts are emscripten-specific, only apply during WASM build
cc_binary(
  name = "markdown_to_html_bin",
  srcs = ["markdown_to_html.c", "markdown_to_html.h"],
  linkopts = [
    "--no-entry",  # No main() function
    "-sALLOW_MEMORY_GROWTH",  # Allow memory to grow dynamically
    "-sEXPORTED_FUNCTIONS=['_markdown_to_html','_markdown_free','_markdown_get_length','_wasm_alloc','_wasm_free']",
    "-sEXPORTED_RUNTIME_METHODS=['cwrap','ccall','UTF8ToString','stringToUTF8','lengthBytesUTF8']",
    "-sMODULARIZE",  # Output as factory function
    "-sEXPORT_ES6",  # Use ES6 module exports
    "-sENVIRONMENT=web",  # Browser-only code (no Node.js builtins)
  ],
  tags=["manual"],
)

wasm_cc_binary(
  name = "markdown_to_html_wasm",
  cc_target = ":markdown_to_html_bin",
  visibility = ["//visibility:public"],
)