# -*- python -*-

load(
    "//tools:fbstab.bzl",
    "fbstab_cc_googletest",
    "fbstab_cc_library",
)

package(default_visibility = ["//fbstab:__pkg__"])

fbstab_cc_library(
    name = "full_variable",
    srcs = ["full_variable.cc"],
    hdrs = [
        "abstract_components.h",
        "full_variable.h",
    ],
    deps = [
        "//tools:essential",
        "@eigen",
    ],
)

fbstab_cc_library(
    name = "full_residual",
    srcs = ["full_residual.cc"],
    hdrs = [
        "abstract_components.h",
        "full_residual.h",
    ],
    deps = [
        ":full_variable",
        "//tools:essential",
        "@eigen",
    ],
)

fbstab_cc_library(
    name = "full_feasibility",
    srcs = ["full_feasibility.cc"],
    hdrs = [
        "abstract_components.h",
        "full_feasibility.h",
    ],
    deps = [
        ":full_variable",
        "//tools:essential",
        "@eigen",
    ],
)

fbstab_cc_library(
    name = "dense_data",
    srcs = ["dense_data.cc"],
    hdrs = [
        "abstract_components.h",
        "dense_data.h",
    ],
    deps = [
        "//tools:essential",
        "@eigen",
    ],
)

fbstab_cc_library(
    name = "dense_cholesky_solver",
    srcs = [
        "dense_cholesky_solver.cc",
    ],
    hdrs = [
        "abstract_components.h",
        "dense_cholesky_solver.h",
    ],
    deps = [
        ":dense_data",
        ":full_residual",
        ":full_variable",
        "//tools:essential",
        "@eigen",
    ],
)

fbstab_cc_library(
    name = "mpc_data",
    srcs = ["mpc_data.cc"],
    hdrs = [
        "abstract_components.h",
        "mpc_data.h",
    ],
    deps = [
        "//tools:essential",
        "@eigen",
    ],
)

fbstab_cc_library(
    name = "riccati_linear_solver",
    srcs = ["riccati_linear_solver.cc"],
    hdrs = [
        "abstract_components.h",
        "riccati_linear_solver.h",
    ],
    deps = [
        ":full_residual",
        ":full_variable",
        ":mpc_data",
        "//tools:essential",
        "@eigen",
    ],
)

# TODO(dliaomcp@umich.edu): Fix the component tests
# fbstab_cc_googletest(
#     name = "dense_unit_tests",
#     srcs = [
#         "test/dense_unit_tests.cc",
#         "test/dense_unit_tests.h",
#     ],
#     deps = [
#         ":dense_cholesky_solver",
#         ":dense_data",
#         ":full_feasibility",
#         ":full_residual",
#         ":full_variable",
#         "//tools:essential",
#     ],
# )

# fbstab_cc_googletest(
#     name = "mpc_unit_tests",
#     srcs = [
#         "test/mpc_component_unit_tests.cc",
#         "test/mpc_component_unit_tests.h",
#     ],
#     deps = [
#         ":full_feasibility",
#         ":full_residual",
#         ":full_variable",
#         ":mpc_data",
#         ":riccati_linear_solver",
#         "//tools:essential",
#         "@eigen",
#     ],
# )
