shaderc.lua 2.9 KB

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