
import("{{Repeat "../" .Depth}}../../../scripts/tint_overrides_with_defaults.gni")

import("${tint_src_dir}/tint.gni")

{{- if or ($.Project.Target $ "test") ($.Project.Target $ "test_cmd")}}
{{/*   newline */}}
if (tint_build_unittests) {
  import("//testing/test.gni")
}
{{- end}}

{{- Eval "TargetIfNotEmpty" ($.Project.Target $ "lib")}}
{{- Eval "TargetIfNotEmpty" ($.Project.Target $ "cmd")}}
{{- Eval "TargetIfNotEmpty" ($.Project.Target $ "test")}}
{{- Eval "TargetIfNotEmpty" ($.Project.Target $ "test_cmd")}}


{{- /*
--------------------------------------------------------------------------------
-- Emits a GN source set if it contains any files
--------------------------------------------------------------------------------
*/ -}}
{{- define "TargetIfNotEmpty"}}
{{-   if $}}
{{-     if len $.SourceFiles}}{{Eval "Target" $}}{{end}}
{{-   end}}
{{- end}}


{{- /*
--------------------------------------------------------------------------------
-- Emits a GN source set
--------------------------------------------------------------------------------
*/ -}}
{{- define "Target"}}

{{-   if Contains (print $.Kind) "test"}}
if (tint_build_unittests) {
{{-   end}}

{{- /* Target condition */}}
{{-   if $.Condition}}
if({{$.Condition}}) {
{{-   end}}

{{  if      $.Kind.IsLib -}}
libtint_source_set("{{$.Directory.Name}}") {
{{- else if $.Kind.IsCmd -}}
executable("{{$.Directory.Name}}") {
{{- else if $.Kind.IsTest -}}
tint_unittests_source_set("unittests") {
  testonly = true
{{- else if $.Kind.IsTestCmd -}}
test("{{$.Directory.Name}}") {
{{- else }}{{Error $.Kind}}
{{- end  }}
{{- if $.OutputName }}
  output_name = "{{$.OutputName}}"
{{- end}}
  sources = [
{{- range $File := $.UnconditionalSourceFiles}}
    "{{TrimPrefix $File.Name $.Directory.Path}}",
{{- end}}
  ]
  deps = [

{{- /* Emit unconditional inernal dependencies */}}
{{- range $Dep := $.Dependencies.UnconditionalInternal}}
    "{{Eval "Dependency" $Dep}}",
{{- end}}

{{- /* Emit unconditional external dependencies */}}
{{- range $Dep := $.Dependencies.UnconditionalExternal}}
    {{Eval "ExternalDependencyTargets" $Dep}}
{{- end}}
  ]

{{- /* Emit conditional source files and dependencies */}}
{{-   range $Cond := $.Conditionals}}
{{/*   newline */}}
  if ({{$Cond.Condition}}) {
{{-     if $Cond.SourceFiles}}
    sources += [
{{-       range $File := $Cond.SourceFiles}}
      "{{TrimPrefix $File.Name $.Directory.Path}}",
{{-       end}}
    ]
{{-     end}}
{{-     if or $Cond.InternalDependencies $Cond.ExternalDependencies}}
    deps += [
{{-       range $Dep := $Cond.InternalDependencies}}
      "{{Eval "Dependency" $Dep}}",
{{-       end}}
{{-       range $Dep := $Cond.ExternalDependencies}}
      {{Eval "ExternalDependencyTargets" $Dep}}
{{-       end}}
    ]
{{-     end}}
  }
{{-   end}}

{{- if $.Dependencies.ContainsExternal "spirv-opt-internal"}}
  public_configs = [ "${tint_spirv_tools_dir}/:spvtools_internal_config" ]
{{- end}}

{{- if $.Kind.IsTestCmd }}
  testonly = true
  configs += [ "${tint_src_dir}:tint_unittests_config" ]

  if (build_with_chromium) {
    configs -= [ "//build/config/compiler:chromium_code" ]
    configs += [ "//build/config/compiler:no_chromium_code" ]
  }
{{- end}}
}

{{- /* Target condition */}}
{{-   if $.Condition}}}{{end}}
{{- /* if(tint_build_unittests) */}}
{{-   if $.Kind.IsTestOrTestCmd}}}{{end}}

{{- end}}

{{- /*
--------------------------------------------------------------------------------
-- Emits a dependency target name
--------------------------------------------------------------------------------
*/ -}}
{{- define "Dependency"}}
{{-   $Path := printf "${tint_src_dir}/%v" $.Directory.Path}}
{{-   if      $.Kind.IsLib  }}{{$Path}}
{{-   else if $.Kind.IsTest }}{{$Path}}:unittests
{{-   else                  }}{{$Path}}:{{$.Kind}}
{{-   end}}
{{- end}}


{{- /*
--------------------------------------------------------------------------------
-- Emits comma separated, quoted external dependency target name(s) with a trailing comma
-- External target names are declared in tools/src/cmd/gen/build/externals.json
--------------------------------------------------------------------------------
*/ -}}
{{- define "ExternalDependencyTargets"}}
{{-        if eq $.Name "abseil"             -}}"${tint_src_dir}:abseil",
{{-   else if eq $.Name "gtest"              -}}"${tint_src_dir}:gmock_and_gtest",
{{-   else if eq $.Name "spirv-tools"        -}}"${tint_spirv_tools_dir}:spvtools_headers", "${tint_spirv_tools_dir}:spvtools_val",
{{-   else if eq $.Name "spirv-opt-internal" -}}"${tint_spirv_tools_dir}:spvtools", "${tint_spirv_tools_dir}:spvtools_opt",
{{-   else if eq $.Name "spirv-headers"      -}}"${tint_spirv_headers_dir}:spv_headers",
{{-   else if eq $.Name "glslang"            -}}"${tint_glslang_dir}:glslang_lib_sources",
{{-   else if eq $.Name "glslang-res-limits" -}}"${tint_glslang_dir}:glslang_default_resource_limits_sources",
{{-   else                                   -}}{{Error (printf "unhandled external dependency '%v'" $)}}
{{-   end}}
{{- end}}

