# Benchmark
# Examples
load(
    "//mace:mace.bzl",
    "if_android",
    "if_hexagon_enabled",
    "if_opencl_enabled",
    "if_openmp_enabled",
)

licenses(["notice"])  # Apache 2.0

cc_binary(
    name = "mace_run_static",
    srcs = [
        "mace_run.cc",
    ],
    copts = [
        "-Werror",
        "-Wextra",
        "-Wno-missing-field-initializers",
    ] + if_opencl_enabled([
        "-DMACE_ENABLE_OPENCL",
    ]) + if_hexagon_enabled([
        "-DMACE_ENABLE_HEXAGON",
    ]),
    linkstatic = 1,
    deps = [
        "//external:gflags_nothreads",
        "//mace/codegen:generated_mace_engine_factory",
        "//mace/codegen:generated_models",
        "//mace/libmace",
        "//mace/utils",
    ],
)

cc_binary(
    name = "mace_run_dynamic",
    srcs = [
        "mace_run.cc",
    ],
    copts = [
        "-Werror",
        "-Wextra",
        "-Wno-missing-field-initializers",
    ] + if_opencl_enabled([
        "-DMACE_ENABLE_OPENCL",
    ]) + if_hexagon_enabled([
        "-DMACE_ENABLE_HEXAGON",
    ]),
    linkopts = [
        "-lm",
    ] + if_android([
        "-ldl",
        "-pie",
        "-llog",
    ]),
    linkstatic = 0,
    deps = [
        "//external:gflags_nothreads",
        "//mace/codegen:generated_mace_engine_factory",
        "//mace/codegen:generated_models",
        "//mace/libmace:libmace_dynamic",
    ],
)
