This is an automated email from the ASF dual-hosted git repository.

leginee pushed a commit to branch bazel-migration
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 7091f16d26945007709ef6a7c51d0135ddce4adc
Author: Peter <[email protected]>
AuthorDate: Thu Oct 8 08:45:26 2026 +0200

    build(xml2cmp): xml2cmp and srvdepy as native cc_binary
    
    Mirrors Executable_xml2cmp.mk and Executable_srvdepy.mk.  The twelve
    sources both executables share go into one static library instead of
    being compiled twice.  Each source subdirectory gets its own /I because
    the sources include same-directory headers with angle brackets, which
    MSVC does not resolve relative to the including file.
    
    Not staged: prj/d.lst is empty and nothing ships either tool; their
    only consumer was dmake's COMPnTYPELIST machinery.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 main/xml2cmp/BUILD.bazel | 81 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/main/xml2cmp/BUILD.bazel b/main/xml2cmp/BUILD.bazel
new file mode 100644
index 0000000000..b2bf0c7ad8
--- /dev/null
+++ b/main/xml2cmp/BUILD.bazel
@@ -0,0 +1,81 @@
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
+
+# xml2cmp — reads an old-style UNO component description (.xml) and emits the
+# component's type list, a C++ description function, or HTML documentation.
+# srvdepy — the same parser turned on a directory of descriptions, reporting
+# service dependencies.  Mirrors Executable_xml2cmp.mk / Executable_srvdepy.mk.
+#
+# A standalone developer tool: no UNO, no sal, only the C++ runtime + stlport.
+# Nothing in the Bazel build consumes it (dmake's rules.mk/settings.mk used it
+# for COMPnTYPELIST, which no migrated module has), so it is built, not staged.
+# source/x2cclass is not built upstream either and is not built here.
+
+_DEFINES = [
+    "WNT",
+    "WIN32",
+]
+
+_COPTS = [
+    "/Zc:forScope",
+    "/GR",
+    "/nologo",
+    "/EHsc",
+    # Same-directory headers are included with angle brackets
+    # (<parse.hxx>, <sistr.hxx>, ...), which MSVC does not resolve relative
+    # to the including file — hence one /I per source subdirectory.
+    "/Imain/xml2cmp/source/inc",
+    "/Imain/xml2cmp/source/support",
+    "/Imain/xml2cmp/source/xcd",
+]
+
+_HDRS = glob([
+    "source/inc/*.h",
+    "source/support/*.hxx",
+    "source/xcd/*.hxx",
+    "source/finder/*.hxx",
+])
+
+# The parser + HTML/index writers shared by both executables.  Upstream
+# compiles them twice, once into each exe; one static library is equivalent.
+cc_library(
+    name = "xml2cmp_common",
+    srcs = [
+        "source/support/badcast.cxx",
+        "source/support/cmdline.cxx",
+        "source/support/heap.cxx",
+        "source/support/sistr.cxx",
+        "source/support/syshelp.cxx",
+        "source/xcd/cr_html.cxx",
+        "source/xcd/cr_index.cxx",
+        "source/xcd/cr_metho.cxx",
+        "source/xcd/filebuff.cxx",
+        "source/xcd/parse.cxx",
+        "source/xcd/xmlelem.cxx",
+        "source/xcd/xmltree.cxx",
+    ],
+    hdrs = _HDRS,
+    copts = _COPTS,
+    defines = _DEFINES,
+    deps = ["//main/stlport:stlport"],
+)
+
+cc_binary(
+    name = "xml2cmp",
+    srcs = ["source/xcd/main.cxx"] + _HDRS,
+    copts = _COPTS,
+    defines = _DEFINES,
+    deps = [":xml2cmp_common"],
+    visibility = ["//visibility:public"],
+)
+
+cc_binary(
+    name = "srvdepy",
+    srcs = [
+        "source/finder/dep_main.cxx",
+        "source/finder/dependy.cxx",
+    ] + _HDRS,
+    copts = _COPTS,
+    defines = _DEFINES,
+    deps = [":xml2cmp_common"],
+    visibility = ["//visibility:public"],
+)

Reply via email to