mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 13:08:13 +00:00
What this does: - Sets up a `migrate_cpp` tool which currently only runs `clang-tidy`. - This is intended to have more transformations in the future. - Sets up a `migrate_cpp.sh` script. - This copies the original woff2 code into a `carbon` directory and runs the `migrate_cpp` tool on it there. - Adds the initial `carbon` directory of woff2 - To be clear, this is currently only updated via `clang-tidy`. - More transformations should be expected in the future. - Minor related edits. For example: - Adjust pre-commit to skip the `carbon` directory, because it's third-party code and shouldn't be edited in the same way. - Adds `@brotli_carbon` as a local repository so that we can "build" outputs. - Makes clang-tidy from the bootstrap toolchain accessible for BUILD dependencies, as it's then used for `migrate_cpp`. What this does not do: - Any actual transformation of C++ code to Carbon Co-authored-by: Matthew Riley <mdriley@gmail.com>
107 lines
2.2 KiB
Python
107 lines
2.2 KiB
Python
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
# Exceptions. See /LICENSE for license information.
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
# Rules are adapted from CMakeLists.txt.
|
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
|
|
|
|
package(
|
|
default_visibility = ["//visibility:public"],
|
|
)
|
|
|
|
# Common part used by decoder and encoder
|
|
cc_library(
|
|
name = "woff2common",
|
|
srcs = [
|
|
"src/table_tags.cc",
|
|
"src/variable_length.cc",
|
|
"src/woff2_common.cc",
|
|
],
|
|
hdrs = [
|
|
"src/buffer.h",
|
|
"src/file.h",
|
|
"src/port.h",
|
|
"src/round.h",
|
|
"src/store_bytes.h",
|
|
"src/table_tags.h",
|
|
"src/variable_length.h",
|
|
"src/woff2_common.h",
|
|
],
|
|
strip_include_prefix = "src/",
|
|
)
|
|
|
|
# WOFF2 Decoder
|
|
cc_library(
|
|
name = "woff2dec",
|
|
srcs = [
|
|
"src/woff2_dec.cc",
|
|
"src/woff2_out.cc",
|
|
],
|
|
hdrs = [
|
|
"include/woff2/decode.h",
|
|
"include/woff2/output.h",
|
|
],
|
|
copts = [
|
|
"-Wno-unused-variable",
|
|
"-Wno-unused-const-variable",
|
|
],
|
|
strip_include_prefix = "include/",
|
|
deps = [
|
|
":woff2common",
|
|
"@brotli//:brotlidec",
|
|
],
|
|
)
|
|
|
|
cc_binary(
|
|
name = "woff2_decompress",
|
|
srcs = ["src/woff2_decompress.cc"],
|
|
deps = [":woff2dec"],
|
|
)
|
|
|
|
# WOFF2 Encoder
|
|
cc_library(
|
|
name = "woff2enc",
|
|
srcs = [
|
|
"src/font.cc",
|
|
"src/font.h",
|
|
"src/glyph.cc",
|
|
"src/glyph.h",
|
|
"src/normalize.cc",
|
|
"src/normalize.h",
|
|
"src/transform.cc",
|
|
"src/transform.h",
|
|
"src/woff2_enc.cc",
|
|
],
|
|
hdrs = [
|
|
"include/woff2/encode.h",
|
|
],
|
|
copts = [
|
|
"-Wno-unused-variable",
|
|
"-Wno-unused-const-variable",
|
|
"-Wno-sign-compare",
|
|
],
|
|
strip_include_prefix = "include/",
|
|
deps = [
|
|
":woff2common",
|
|
"@brotli//:brotlienc",
|
|
],
|
|
)
|
|
|
|
cc_binary(
|
|
name = "woff2_compress",
|
|
srcs = ["src/woff2_compress.cc"],
|
|
deps = [":woff2enc"],
|
|
)
|
|
|
|
# WOFF2 info
|
|
cc_binary(
|
|
name = "woff2_info",
|
|
srcs = [
|
|
"src/font.h",
|
|
"src/woff2_info.cc",
|
|
],
|
|
copts = ["-Wno-sign-compare"],
|
|
deps = [":woff2common"],
|
|
)
|