# 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.

include(CMakeParseArguments)

# sparrow_test()
#
# A wrapper for the iree_cc_binary to attach lit run files to an executable
# Parameters:
# NAME: Name of target.
# SRCS: List of source files for the binary
# DEPS: List of other libraries to be linked in to the binary targets
# COPTS: List of public defines
# LINKOPTS: List of link options
# TESTFILES: List of lit test run files
#
# Examples:
# sparrow_test(
#   NAME
#     simple_int_vec_mul_emitc_static
#   SRCS
#     "int_vec.c"
#   DEPS
#     ::simple_int_mul_c_module_static_c
#     ::simple_int_mul_c_module_static_emitc
#     samples::util::util
#   COPTS
#     "-DBUILD_EMITC"
#   TESTFILES
#     "simple_test.run"
# )
function(sparrow_test)
  cmake_parse_arguments(
    _RULE
    ""
    "NAME"
    "SRCS;COPTS;LINKOPTS;DEPS;TESTFILES"
    ${ARGN}
  )

  iree_cc_binary(
    NAME
      ${_RULE_NAME}
    SRCS
      ${_RULE_SRCS}
    DEPS
      ${_RULE_DEPS}
    COPTS
      ${_RULE_COPTS}
    LINKOPTS
      ${_RULE_LINKOPTS}
  )
  if(NOT _RULE_TESTFILES)
    return()
  endif()

  iree_package_name(_PACKAGE_NAME)
  foreach(_FILE ${_RULE_TESTFILES})
    get_filename_component(_FILE_PATH ${_FILE} REALPATH)
    get_filename_component(_FILE_NAME ${_FILE_PATH} NAME)
    set(_FILE_TARGET ${_PACKAGE_NAME}_${_FILE_NAME})
    if(NOT TARGET ${_FILE_TARGET})
      add_custom_target(
        ${_FILE_TARGET}
        COMMAND ${CMAKE_COMMAND} -E copy ${_FILE_PATH}
          ${CMAKE_CURRENT_BINARY_DIR}/${_FILE_NAME}
        BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/${_FILE_NAME}
        COMMENT "Copy lit run file ${_FILE_NAME}"
        VERBATIM
      )
    endif()

    add_dependencies(${_PACKAGE_NAME}_${_RULE_NAME} ${_FILE_TARGET})
  endforeach()
endfunction()
