load("//tools/lint:lint.bzl", "add_lint_tests")
load("//tools/skylark:drake_py.bzl", "drake_py_binary", "drake_py_library")
load(
    "//tools/skylark:drake_runfiles_binary.bzl",
    "drake_runfiles_binary",
)

package(default_visibility = ["//visibility:public"])

drake_py_library(
    name = "module_py",
    srcs = ["__init__.py"],
    visibility = [":__subpackages__"],
)

alias(
    name = "meldis",
    actual = "//bindings/pydrake/visualization:meldis",
)

alias(
    name = "model_visualizer",
    actual = "//bindings/pydrake/visualization:model_visualizer",
)

drake_py_binary(
    name = "model_visualizer_private",
    testonly = True,
    srcs = ["model_visualizer_private.py"],
    data = ["//:some_test_models"],
    visibility = ["//visibility:private"],
    deps = ["//bindings/pydrake/visualization:model_visualizer"],
)

alias(
    name = "mesh_to_model",
    actual = "//bindings/pydrake/multibody:mesh_to_model",
)

alias(
    name = "fix_inertia",
    actual = "//bindings/pydrake/multibody:fix_inertia",
)

# === config_setting rules ===

# When this is set, a Drake build will promote some warnings to errors.
# See drake/tools/cc_toolchain/bazel.rc for details.
config_setting(
    name = "drake_werror",
    values = {"define": "DRAKE_WERROR=ON"},
)

config_setting(
    name = "with_gurobi",
    values = {"define": "WITH_GUROBI=ON"},
)

config_setting(
    name = "with_mosek",
    values = {"define": "WITH_MOSEK=ON"},
)

config_setting(
    name = "with_snopt",
    values = {"define": "WITH_SNOPT=ON"},
)

config_setting(
    name = "using_sanitizer",
    values = {"define": "USING_SANITIZER=ON"},
)

config_setting(
    name = "using_memcheck",
    values = {"define": "USING_MEMCHECK=ON"},
)

# Clarabel is an open-source solver, and is included in the Drake build by
# default. The Clarabel solver is irrelevant to some users of
# MathematicalProgram, so we provide a hidden switch to shut it off for
# developers who don't actually need it. This is not a supported configuration.
# Use at your own risk: --define=NO_CLARABEL=ON
config_setting(
    name = "no_clarabel",
    values = {"define": "NO_CLARABEL=ON"},
)

# CLP is an open-source solver, and is included in the Drake build by
# default. The CLP solver is irrelevant to some users of MathematicalProgram,
# so we provide a hidden switch to shut it off for developers who don't
# actually need it.  This is not a supported configuration. Use at your own
# risk: --define=NO_CLP=ON
config_setting(
    name = "no_clp",
    values = {"define": "NO_CLP=ON"},
)

# CSDP is an open-source solver, and is included in the Drake build by default.
# The CSDP solver is irrelevant to some users of MathematicalProgram, so we
# provide a hidden switch to shut it off for developers who don't actually need
# it. This is not a supported configuration. Use at your own risk:
# --define=NO_CSDP=ON
config_setting(
    name = "no_csdp",
    values = {"define": "NO_CSDP=ON"},
)

# IPOPT is an open-source solver, and is included in the Drake build by
# default. The IPOPT solver is irrelevant to some users of MathematicalProgram,
# so we provide a hidden switch to shut it off for developers who don't
# actually need it.  This is not a supported configuration. Use at your own
# risk: --define=NO_IPOPT=ON
config_setting(
    name = "no_ipopt",
    values = {"define": "NO_IPOPT=ON"},
)

# NLOPT is an open-source solver, and is included in the Drake build by
# default. The NLOPT solver is irrelevant to some users of MathematicalProgram,
# so we provide a hidden switch to shut it off for developers who don't
# actually need it.  This is not a supported configuration. Use at your own
# risk: --define=NO_NLOPT=ON
config_setting(
    name = "no_nlopt",
    values = {"define": "NO_NLOPT=ON"},
)

# OSQP is an open-source solver, and is included in the Drake build by
# default. The OSQP solver is irrelevant to some users of MathematicalProgram,
# so we provide a hidden switch to shut it off for developers who don't
# actually need it.  This is not a supported configuration. Use at your own
# risk: --define=NO_OSQP=ON
config_setting(
    name = "no_osqp",
    values = {"define": "NO_OSQP=ON"},
)

# SCS is an open-source solver, and is included in the Drake build by default.
# The SCS solver is irrelevant to some users of MathematicalProgram, so we
# provide a hidden switch to shut it off for developers who don't actually need
# it. This is not a supported configuration. Use at your own risk:
# --define=NO_SCS=ON
config_setting(
    name = "no_scs",
    values = {"define": "NO_SCS=ON"},
)

# We are exploring adding USD support to Drake. For the moment, it is opt-in.
# See https://github.com/PixarAnimationStudios/OpenUSD for details.
# Use `--define=WITH_USD=ON` on the bazel command line to enable it.
# (In CI, --config=everything also enables it on Ubuntu.)
config_setting(
    name = "with_usd",
    values = {"define": "WITH_USD=ON"},
)

config_setting(
    name = "ubuntu_jammy",
    values = {"define": "UBUNTU_VERSION=22.04"},
)

config_setting(
    name = "ubuntu_noble",
    values = {"define": "UBUNTU_VERSION=24.04"},
)

add_lint_tests()
