# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NvidiaProprietary
#
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
# property and proprietary rights in and to this material, related
# documentation and any modifications thereto. Any use, reproduction,
# disclosure or distribution of this material and related documentation
# without an express license agreement from NVIDIA CORPORATION or
# its affiliates is strictly prohibited.

add_library(deser_max96724_driver
    MAX96724.cpp
    ${UDDF_CDD_DRIVER}/deserializers/MAX967XX/MAX967XX.cpp
)
add_library(uddf-cdd::deser_max96724_driver ALIAS deser_max96724_driver)

target_compile_features(deser_max96724_driver PUBLIC cxx_std_17)

# --- Include Directories ---
target_include_directories(deser_max96724_driver
    PUBLIC
        ${CMAKE_CURRENT_SOURCE_DIR}
        ${UDDF_CDD_DRIVER}
        ${CMAKE_CURRENT_BINARY_DIR}/hsl_gen
)

target_link_libraries(deser_max96724_driver PUBLIC uddf::uddf)

# MAX967XXHsl.py is a base-class module (abstract, no main()) used by MAX96724Hsl.py.
# Pass it as a DEPENDENCY so hslcompile.py can import it when compiling MAX96724Hsl.py.
#
# MAX96724Hsl.py calls super().compile() which emits ALL base + MAX96724-specific
# sequences.  We use OUTPUT_NAMES to produce "MAX967XXHsl.hpp" (the name that
# MAX967XX.cpp and MAX96724.cpp include) rather than the default "MAX96724Hsl.hpp".
hsl_add_driver_sources(deser_max96724_driver
  SOURCES MAX96724Hsl.py
  NAMESPACE uddf::cdd::max967xx::hsl
  OUTPUT_NAMES "MAX96724Hsl.py=MAX967XXHsl"
  DEPENDENCIES ${UDDF_CDD_DRIVER}/deserializers/MAX967XX/MAX967XXHsl.py
)
