import("$tizen_core/build/native/project.gni")

config("{{.Name}}_public_config") {
    include_dirs = [
      {{- range .IncludeDirs}}
        "{{.}}",
      {{- end}}
    ]
}

config("{{.Name}}_config") {
  {{- if .Cflags }}

    cflags = [
      {{- range .Cflags}}
        "{{.}}",
      {{- end}}
    ]

  {{- end}}

  {{- if .CflagsC }}

    cflags_c = [
      {{- range .CflagsC}}
        "{{.}}",
      {{- end}}
    ]

  {{- end}}

  {{- if .CflagsCc }}

    cflags_cc = [
      {{- range .CflagsCc}}
        "{{.}}",
      {{- end}}
    ]
  {{- end}}

  {{- if .Asmflags }}

    asmflags = [
      {{- range .Asmflags}}
        "{{.}}",
      {{- end}}
    ]

  {{- end}}

  {{- if .Defines }}

    defines = [
      {{- range .Defines}}
        "{{.}}",
      {{- end}}
    ]

  {{- end}}

  {{- if .LibDirs }}

    lib_dirs = [
      {{- range .LibDirs}}
        "{{.}}",
      {{- end}}
    ]

  {{- end}}

  {{- if .Libs }}

    libs = [
      {{- range .Libs}}
        "{{.}}",
      {{- end}}
    ]

  {{- end}}

  {{- if .Ldflags }}

    ldflags = [
      {{- range .Ldflags}}
        "{{.}}",
      {{- end}}
    ]

  {{- end}}
}

native_project("{{.Name}}") {
  output_name = "{{.OutputName}}"
  project_type = "{{.Type}}"

  src_files = [
    {{- range .Sources}}
      "{{.}}",
    {{- end}}
  ]

  {{- if .LibFiles }}

  lib_files =  [
    {{- range .LibFiles}}
      "{{.}}",
    {{- end}}
  ]

  {{- end}}

  {{- if .EdcFiles }}

  edc_files =  [
    {{- range .EdcFiles}}
      "{{.}}",
    {{- end}}
  ]

  {{- end}}

  {{- if .EdcImagesDirs }}

  image_dirs = [
    {{- range .EdcImagesDirs}}
      "{{.}}",
    {{- end}}
  ]

  {{- end}}

  {{- if .EdcSoundDirs }}

  sound_dirs = [
    {{- range .EdcSoundDirs}}
      "{{.}}",
    {{- end}}
  ]

  {{- end}}

  {{- if .EdcFontDirs }}

  font_dirs = [
    {{- range .EdcFontDirs}}
      "{{.}}",
    {{- end}}
  ]

  {{- end}}

  {{- if .PoFiles }}

  po_files = [
    {{- range .PoFiles}}
      "{{.}}",
    {{- end}}
  ]

  {{- end}}

  {{- if .Resources }}

  resources = [
    {{- range .Resources}}
      "{{.}}",
    {{- end}}
  ]

  {{- end}}

  deps = [
    {{- range .Deps}}
      "//{{.}}",
    {{- end}}
  ]

  public_configs = [
      ":{{.Name}}_public_config",
  ]

  configs = [
      ":{{.Name}}_config",
  ]
}
