chromium/ios/chrome/browser/optimization_guide/resources/BUILD.gn

# Copyright 2024 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/buildflag_header.gni")
import("//components/optimization_guide/features.gni")

buildflag_header("on_device_llm_buildflags") {
  _model_name = ""
  _model_extension = ""
  if (ios_on_device_llm_path != "") {
    _model_name = get_path_info(ios_on_device_llm_path, "name")
    _model_extension = get_path_info(ios_on_device_llm_path, "extension")
  }

  header = "on_device_llm_buildflags.h"
  flags = [
    "IOS_ON_DEVICE_LLM_NAME=\"$_model_name\"",
    "IOS_ON_DEVICE_LLM_EXTENSION=\"$_model_extension\"",
  ]
}

if (ios_on_device_llm_path != "") {
  bundle_data("on_device_llm_bundle_data") {
    sources = [ ios_on_device_llm_path ]
    outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
  }
} else {
  group("on_device_llm_bundle_data") {
  }
}