blob: 436cff15c8e6c878bc1cfd7581fe490fc3a2176b [file] [log] [blame]
Mike Klein38af9432016-11-11 11:39:44 -05001# Copyright 2016 Google Inc.
2#
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6declare_args() {
Mike Kleine459afd2017-03-03 09:21:30 -05007 skia_use_system_lua = is_official_build
Mike Klein38af9432016-11-11 11:39:44 -05008}
9
10import("../third_party.gni")
11
12if (skia_use_system_lua) {
13 system("lua") {
14 libs = [ "lua" ]
15 }
16} else {
17 third_party("lua") {
Mike Kleinb19737d2018-01-10 08:09:06 -050018 public_include_dirs = [ "../externals/lua" ]
Mike Klein38af9432016-11-11 11:39:44 -050019
20 sources = [
Mike Kleinb19737d2018-01-10 08:09:06 -050021 "../externals/lua/lapi.c",
22 "../externals/lua/lauxlib.c",
23 "../externals/lua/lbaselib.c",
24 "../externals/lua/lbitlib.c",
25 "../externals/lua/lcode.c",
26 "../externals/lua/lcorolib.c",
27 "../externals/lua/lctype.c",
28 "../externals/lua/ldblib.c",
29 "../externals/lua/ldebug.c",
30 "../externals/lua/ldo.c",
31 "../externals/lua/ldump.c",
32 "../externals/lua/lfunc.c",
33 "../externals/lua/lgc.c",
34 "../externals/lua/linit.c",
35 "../externals/lua/liolib.c",
36 "../externals/lua/llex.c",
37 "../externals/lua/lmathlib.c",
38 "../externals/lua/lmem.c",
39 "../externals/lua/loadlib.c",
40 "../externals/lua/lobject.c",
41 "../externals/lua/lopcodes.c",
42 "../externals/lua/loslib.c",
43 "../externals/lua/lparser.c",
44 "../externals/lua/lstate.c",
45 "../externals/lua/lstring.c",
46 "../externals/lua/lstrlib.c",
47 "../externals/lua/ltable.c",
48 "../externals/lua/ltablib.c",
49 "../externals/lua/ltm.c",
50 "../externals/lua/lundump.c",
51 "../externals/lua/lutf8lib.c",
52 "../externals/lua/lvm.c",
53 "../externals/lua/lzio.c",
Mike Klein38af9432016-11-11 11:39:44 -050054 ]
Mike Kleinbec7ec62018-02-01 17:10:03 -050055
56 if (!is_win) {
57 # Prefer mkstemp() over tmpnam(). This isn't super important,
58 # but it does stifle an annoying GNU linker warning.
59 defines = [ "LUA_USE_POSIX=1" ]
60 }
Mike Klein38af9432016-11-11 11:39:44 -050061 }
62}