shaderc.lua 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. --
  2. -- Copyright (c) 2012-2017 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-*" }
  36. targetextension ".exe"
  37. configuration { "mingw* or linux or osx" }
  38. buildoptions {
  39. "-fno-strict-aliasing", -- glsl-optimizer has bugs if strict aliasing is used.
  40. "-Wno-unused-parameter",
  41. }
  42. removebuildoptions {
  43. "-Wshadow", -- glsl-optimizer is full of -Wshadow warnings ignore it.
  44. }
  45. configuration { "osx" }
  46. links {
  47. "Cocoa.framework",
  48. }
  49. configuration { "vs*" }
  50. includedirs {
  51. path.join(GLSL_OPTIMIZER, "include/c99"),
  52. }
  53. configuration {}
  54. defines { -- fcpp
  55. "NINCLUDE=64",
  56. "NWORK=65536",
  57. "NBUFF=65536",
  58. "OLD_PREPROCESSOR=0",
  59. }
  60. includedirs {
  61. path.join(BX_DIR, "include"),
  62. path.join(BGFX_DIR, "include"),
  63. path.join(BGFX_DIR, "3rdparty/dxsdk/include"),
  64. FCPP_DIR,
  65. path.join(GLSL_OPTIMIZER, "include"),
  66. path.join(GLSL_OPTIMIZER, "src/mesa"),
  67. path.join(GLSL_OPTIMIZER, "src/mapi"),
  68. path.join(GLSL_OPTIMIZER, "src/glsl"),
  69. }
  70. files {
  71. path.join(BGFX_DIR, "tools/shaderc/**.cpp"),
  72. path.join(BGFX_DIR, "tools/shaderc/**.h"),
  73. path.join(BGFX_DIR, "src/vertexdecl.**"),
  74. path.join(FCPP_DIR, "**.h"),
  75. path.join(FCPP_DIR, "cpp1.c"),
  76. path.join(FCPP_DIR, "cpp2.c"),
  77. path.join(FCPP_DIR, "cpp3.c"),
  78. path.join(FCPP_DIR, "cpp4.c"),
  79. path.join(FCPP_DIR, "cpp5.c"),
  80. path.join(FCPP_DIR, "cpp6.c"),
  81. path.join(FCPP_DIR, "cpp6.c"),
  82. path.join(GLSL_OPTIMIZER, "src/mesa/**.c"),
  83. path.join(GLSL_OPTIMIZER, "src/glsl/**.cpp"),
  84. path.join(GLSL_OPTIMIZER, "src/mesa/**.h"),
  85. path.join(GLSL_OPTIMIZER, "src/glsl/**.c"),
  86. path.join(GLSL_OPTIMIZER, "src/glsl/**.cpp"),
  87. path.join(GLSL_OPTIMIZER, "src/glsl/**.h"),
  88. path.join(GLSL_OPTIMIZER, "src/util/**.c"),
  89. path.join(GLSL_OPTIMIZER, "src/util/**.h"),
  90. }
  91. removefiles {
  92. path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/glcpp.c"),
  93. path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/tests/**"),
  94. path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/**.l"),
  95. path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/**.y"),
  96. path.join(GLSL_OPTIMIZER, "src/glsl/ir_set_program_inouts.cpp"),
  97. path.join(GLSL_OPTIMIZER, "src/glsl/main.cpp"),
  98. path.join(GLSL_OPTIMIZER, "src/glsl/builtin_stubs.cpp"),
  99. }
  100. strip()