# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# sparrow_modules()
#
# A wrapper for the sparrow_static_module and sparrow_vmvx_module to apply common iree-compile flags
# Parameters:
# NAME: Name of target.
# SRC: Source file to compile into a bytecode module. Support relative path.
# FLAGS: Flags to pass to the translation tool (list of strings).
# C_IDENTIFIER: Identifier to use for generate c embed code.
#     If omitted then no C embed code will be generated.
# TFLITE_OUTPUT: TFLite output array name
# RVV_OFF: Indicate RVV is OFF (default: ON)
# VMVX: Compile VMVX backend
# INLINE_HAL: Use inline HAL.
#
# Examples:
# sparrow_modules(
#   NAME
#     dare_devel
#   SRC
#     "daredevil_quant.tflite"
#   C_IDENTIFIER
#     "daredevil_bytecode_module_static"
#   FLAGS
#     "-iree-input-type=tosa"
# )
#
# sparrow_modules(
#   NAME
#     simple_float_mul
#   SRC
#     "simple_float_mul.mlir"
#   C_IDENTIFIER
#     "simple_float_mul"
#   FLAGS
#     "-iree-input-type=mhlo"
#   RVV_OFF
#   PUBLIC
# )
#

function(sparrow_modules)
  cmake_parse_arguments(
    _RULE
    "PUBLIC;RVV_OFF;VMVX;INLINE_HAL"
    "NAME;SRC;C_IDENTIFIER;TFLITE_OUTPUT"
    "FLAGS"
    ${ARGN}
  )

  if (${_RULE_RVV_OFF} OR (NOT ${BUILD_WITH_RVV}))
    set(_RVV_OFF_ARG "RVV_OFF")
  endif()

  if (${_RULE_INLINE_HAL})
    set(_INLINE_HAL_ARG "INLINE_HAL")
  endif()

  sparrow_static_module(
    NAME
      "${_RULE_NAME}_bytecode_module_static"
    SRC
      "${_RULE_SRC}"
    C_IDENTIFIER
      "${_RULE_C_IDENTIFIER}_bytecode_module_static"
    TFLITE_OUTPUT
      "${_RULE_TFLITE_OUTPUT}"
    FLAGS
      "${_RULE_FLAGS}"
    "${_RVV_OFF_ARG}"
    "${_INLINE_HAL_ARG}"
  )

  sparrow_static_module(
    NAME
      "${_RULE_NAME}_c_module_static"
    SRC
      "${_RULE_SRC}"
    TFLITE_OUTPUT
      "${_RULE_TFLITE_OUTPUT}"
    FLAGS
      "${_RULE_FLAGS}"
    "${_RVV_OFF_ARG}"
    "${_INLINE_HAL_ARG}"
    EMITC
  )

  if (${_RULE_VMVX})
    sparrow_vmvx_module(
      NAME
        "${_RULE_NAME}_bytecode_module_vmvx"
      SRC
        "${_RULE_SRC}"
      C_IDENTIFIER
        "${_RULE_C_IDENTIFIER}_bytecode_module_vmvx"
      TFLITE_OUTPUT
        "${_RULE_TFLITE_OUTPUT}"
      FLAGS
        "${_RULE_FLAGS}"
      "${_INLINE_HAL_ARG}"
    )

    sparrow_vmvx_module(
      NAME
        "${_RULE_NAME}_c_module_vmvx"
      SRC
        "${_RULE_SRC}"
      TFLITE_OUTPUT
        "${_RULE_TFLITE_OUTPUT}"
      FLAGS
        "${_RULE_FLAGS}"
      "${_INLINE_HAL_ARG}"
      EMITC
    )
  endif()

endfunction()
