shaderc.lua 2.4 KB

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