# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

declare_args() {
  skia_use_system_lua = is_official_build
}

import("../third_party.gni")

if (skia_use_system_lua) {
  system("lua") {
    libs = [ "lua" ]
  }
} else {
  third_party("lua") {
    public_include_dirs = [ "../externals/lua" ]

    sources = [
      "../externals/lua/lapi.c",
      "../externals/lua/lauxlib.c",
      "../externals/lua/lbaselib.c",
      "../externals/lua/lbitlib.c",
      "../externals/lua/lcode.c",
      "../externals/lua/lcorolib.c",
      "../externals/lua/lctype.c",
      "../externals/lua/ldblib.c",
      "../externals/lua/ldebug.c",
      "../externals/lua/ldo.c",
      "../externals/lua/ldump.c",
      "../externals/lua/lfunc.c",
      "../externals/lua/lgc.c",
      "../externals/lua/linit.c",
      "../externals/lua/liolib.c",
      "../externals/lua/llex.c",
      "../externals/lua/lmathlib.c",
      "../externals/lua/lmem.c",
      "../externals/lua/loadlib.c",
      "../externals/lua/lobject.c",
      "../externals/lua/lopcodes.c",
      "../externals/lua/loslib.c",
      "../externals/lua/lparser.c",
      "../externals/lua/lstate.c",
      "../externals/lua/lstring.c",
      "../externals/lua/lstrlib.c",
      "../externals/lua/ltable.c",
      "../externals/lua/ltablib.c",
      "../externals/lua/ltm.c",
      "../externals/lua/lundump.c",
      "../externals/lua/lutf8lib.c",
      "../externals/lua/lvm.c",
      "../externals/lua/lzio.c",
    ]
  }
}