view third_party/ffmpeg/BUILD @ 217:7ef4c9d2a72d hg-web

[DO NOT PUSH] Random values.
author MrJuneJune <me@mrjunejune.com>
date Sun, 25 Jan 2026 10:44:04 -0800
parents
children
line wrap: on
line source

# Assumes ffmpeg is installed on the system (apt install ffmpeg / brew install ffmpeg)
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_cc//cc:cc_test.bzl", "cc_test")

cc_library(
    name = "ffmpeg",
    hdrs = ["ffmpeg.h"],
    srcs = ["ffmpeg_wrapper.c"],
    linkopts = select({
        "@platforms//os:linux": [
            "-lavcodec",
            "-lavformat",
            "-lavutil",
            "-lswscale",
            "-lswresample",
        ],
        "@platforms//os:macos": [
            "-lavcodec",
            "-lavformat",
            "-lavutil",
            "-lswscale",
            "-lswresample",
        ],
        "//conditions:default": [],
    }),
    copts = select({
        "@platforms//os:linux": ["-I/usr/include/ffmpeg"],
        "@platforms//os:macos": ["-I/opt/homebrew/include", "-I/usr/local/include"],
        "//conditions:default": [],
    }),
    visibility = ["//visibility:public"],
)

# For projects that just need to shell out to ffmpeg CLI
cc_library(
    name = "ffmpeg_cli",
    hdrs = ["ffmpeg_cli.h"],
    srcs = ["ffmpeg_cli.c"],
    visibility = ["//visibility:public"],
)