lua.BUILD 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # Copyright (c) 2009-2021, Google LLC
  2. # All rights reserved.
  3. #
  4. # Redistribution and use in source and binary forms, with or without
  5. # modification, are permitted provided that the following conditions are met:
  6. # * Redistributions of source code must retain the above copyright
  7. # notice, this list of conditions and the following disclaimer.
  8. # * Redistributions in binary form must reproduce the above copyright
  9. # notice, this list of conditions and the following disclaimer in the
  10. # documentation and/or other materials provided with the distribution.
  11. # * Neither the name of Google LLC nor the
  12. # names of its contributors may be used to endorse or promote products
  13. # derived from this software without specific prior written permission.
  14. #
  15. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  16. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  17. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  18. # DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
  19. # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  20. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  21. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  22. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  23. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  24. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. package(
  26. default_visibility = ["//visibility:public"],
  27. )
  28. cc_library(
  29. name = "liblua_headers",
  30. hdrs = [
  31. "src/lauxlib.h",
  32. "src/lua.h",
  33. "src/lua.hpp",
  34. "src/luaconf.h",
  35. "src/lualib.h",
  36. ],
  37. defines = ["LUA_USE_LINUX"],
  38. includes = ["src"],
  39. )
  40. cc_library(
  41. name = "liblua",
  42. srcs = [
  43. "src/lapi.c",
  44. "src/lapi.h",
  45. "src/lauxlib.c",
  46. "src/lauxlib.h",
  47. "src/lbaselib.c",
  48. "src/lbitlib.c",
  49. "src/lcode.c",
  50. "src/lcode.h",
  51. "src/lcorolib.c",
  52. "src/lctype.c",
  53. "src/lctype.h",
  54. "src/ldblib.c",
  55. "src/ldebug.c",
  56. "src/ldebug.h",
  57. "src/ldo.c",
  58. "src/ldo.h",
  59. "src/ldump.c",
  60. "src/lfunc.c",
  61. "src/lfunc.h",
  62. "src/lgc.c",
  63. "src/lgc.h",
  64. "src/linit.c",
  65. "src/liolib.c",
  66. "src/llex.c",
  67. "src/llex.h",
  68. "src/llimits.h",
  69. "src/lmathlib.c",
  70. "src/lmem.c",
  71. "src/lmem.h",
  72. "src/loadlib.c",
  73. "src/lobject.c",
  74. "src/lobject.h",
  75. "src/lopcodes.c",
  76. "src/lopcodes.h",
  77. "src/loslib.c",
  78. "src/lparser.c",
  79. "src/lparser.h",
  80. "src/lstate.c",
  81. "src/lstate.h",
  82. "src/lstring.c",
  83. "src/lstring.h",
  84. "src/lstrlib.c",
  85. "src/ltable.c",
  86. "src/ltable.h",
  87. "src/ltablib.c",
  88. "src/ltm.c",
  89. "src/ltm.h",
  90. "src/lundump.c",
  91. "src/lundump.h",
  92. "src/lvm.c",
  93. "src/lvm.h",
  94. "src/lzio.c",
  95. "src/lzio.h",
  96. ],
  97. hdrs = [
  98. "src/lauxlib.h",
  99. "src/lua.h",
  100. "src/lua.hpp",
  101. "src/luaconf.h",
  102. "src/lualib.h",
  103. ],
  104. defines = ["LUA_USE_LINUX"],
  105. includes = ["src"],
  106. linkopts = [
  107. "-lm",
  108. "-ldl",
  109. ],
  110. )
  111. cc_binary(
  112. name = "lua",
  113. srcs = [
  114. "src/lua.c",
  115. ],
  116. linkopts = [
  117. "-lreadline",
  118. "-rdynamic",
  119. ],
  120. deps = [
  121. ":liblua",
  122. ],
  123. )