shaderc.lua 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. --
  2. -- Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
  3. -- License: https://github.com/taylor001/crown/blob/master/LICENSE
  4. --
  5. --
  6. -- Copyright 2010-2016 Branimir Karadzic. All rights reserved.
  7. -- License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
  8. --
  9. project "shaderc"
  10. uuid "f3cd2e90-52a4-11e1-b86c-0800200c9a66"
  11. kind "ConsoleApp"
  12. local GLSL_OPTIMIZER = path.join(BGFX_DIR, "3rdparty/glsl-optimizer")
  13. local FCPP_DIR = path.join(BGFX_DIR, "3rdparty/fcpp")
  14. includedirs {
  15. path.join(GLSL_OPTIMIZER, "src"),
  16. }
  17. removeflags {
  18. -- GCC 4.9 -O2 + -fno-strict-aliasing don't work together...
  19. "OptimizeSpeed",
  20. }
  21. configuration { "vs*" }
  22. includedirs {
  23. path.join(GLSL_OPTIMIZER, "src/glsl/msvc"),
  24. }
  25. defines { -- glsl-optimizer
  26. "__STDC__",
  27. "__STDC_VERSION__=199901L",
  28. "strdup=_strdup",
  29. "alloca=_alloca",
  30. "isascii=__isascii",
  31. }
  32. buildoptions {
  33. "/wd4996" -- warning C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup.
  34. }
  35. configuration { "mingw* or linux or osx" }
  36. buildoptions {
  37. "-fno-strict-aliasing", -- glsl-optimizer has bugs if strict aliasing is used.
  38. "-Wno-unused-parameter",
  39. }
  40. removebuildoptions {
  41. "-Wshadow", -- glsl-optimizer is full of -Wshadow warnings ignore it.
  42. }
  43. configuration { "osx" }
  44. links {
  45. "Cocoa.framework",
  46. }
  47. configuration { "vs*" }
  48. includedirs {
  49. path.join(GLSL_OPTIMIZER, "include/c99"),
  50. }
  51. configuration { "vs* or mingw*" }
  52. links {
  53. "d3dcompiler",
  54. }
  55. configuration {}
  56. defines { -- fcpp
  57. "NINCLUDE=64",
  58. "NWORK=65536",
  59. "NBUFF=65536",
  60. "OLD_PREPROCESSOR=0",
  61. }
  62. includedirs {
  63. path.join(BX_DIR, "include"),
  64. path.join(BGFX_DIR, "include"),
  65. FCPP_DIR,
  66. path.join(GLSL_OPTIMIZER, "include"),
  67. path.join(GLSL_OPTIMIZER, "src/mesa"),
  68. path.join(GLSL_OPTIMIZER, "src/mapi"),
  69. path.join(GLSL_OPTIMIZER, "src/glsl"),
  70. }
  71. files {
  72. path.join(BGFX_DIR, "tools/shaderc/**.cpp"),
  73. path.join(BGFX_DIR, "tools/shaderc/**.h"),
  74. path.join(BGFX_DIR, "src/vertexdecl.**"),
  75. path.join(FCPP_DIR, "**.h"),
  76. path.join(FCPP_DIR, "cpp1.c"),
  77. path.join(FCPP_DIR, "cpp2.c"),
  78. path.join(FCPP_DIR, "cpp3.c"),
  79. path.join(FCPP_DIR, "cpp4.c"),
  80. path.join(FCPP_DIR, "cpp5.c"),
  81. path.join(FCPP_DIR, "cpp6.c"),
  82. path.join(FCPP_DIR, "cpp6.c"),
  83. path.join(GLSL_OPTIMIZER, "src/mesa/**.c"),
  84. path.join(GLSL_OPTIMIZER, "src/glsl/**.cpp"),
  85. path.join(GLSL_OPTIMIZER, "src/mesa/**.h"),
  86. path.join(GLSL_OPTIMIZER, "src/glsl/**.c"),
  87. path.join(GLSL_OPTIMIZER, "src/glsl/**.cpp"),
  88. path.join(GLSL_OPTIMIZER, "src/glsl/**.h"),
  89. path.join(GLSL_OPTIMIZER, "src/util/**.c"),
  90. path.join(GLSL_OPTIMIZER, "src/util/**.h"),
  91. }
  92. removefiles {
  93. path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/glcpp.c"),
  94. path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/tests/**"),
  95. path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/**.l"),
  96. path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/**.y"),
  97. path.join(GLSL_OPTIMIZER, "src/glsl/ir_set_program_inouts.cpp"),
  98. path.join(GLSL_OPTIMIZER, "src/glsl/main.cpp"),
  99. path.join(GLSL_OPTIMIZER, "src/glsl/builtin_stubs.cpp"),
  100. }
  101. strip()