# Copyright 2023 The Dawn Authors
#
# 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.

# cmake_configure_file implements CMake's 'configure_file':
# https://cmake.org/cmake/help/latest/command/configure_file.html
#
# Unlike CMake, that replaces variables defined in the input file with those
# currently set in the CMake exceution environment, we must provide the
# values for each variable explicitly via the 'values' array.
template("cmake_configure_file") {
  assert(defined(invoker.input), "must set 'input'")
  assert(defined(invoker.output), "must set 'output'")
  assert(defined(invoker.values), "must set 'values'")

  action(target_name) {
    script = "${invoker.dawn_dxc_gn_dir}/dxc/build/cmake_configure_file.py"
    sources = [ invoker.input ]
    outputs = [ invoker.output ]
    args = [
             rebase_path(invoker.input, root_build_dir),
             rebase_path(invoker.output, root_build_dir),
           ] + invoker.values
  }
}
