xmake.lua 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. add_rules("mode.debug", "mode.release")
  2. set_languages("c++14")
  3. if is_plat("linux") then
  4. add_requires("egl-headers", "libpng", "libx11")
  5. add_packages("egl-headers", "libpng", "libx11")
  6. end
  7. target("gtgraphics")
  8. add_rules("utils.install.cmake_importfiles")
  9. set_kind("$(kind)")
  10. add_includedirs("GTE", {public = true})
  11. add_headerfiles("(GTE/Graphics/**.h)")
  12. add_files("GTE/Graphics/**.cpp")
  13. if is_plat("linux") then
  14. add_syslinks("GL", "GLX", "EGL", "X11")
  15. add_defines("GTE_USE_LINUX", "GTE_USE_ROW_MAJOR", "GTE_USE_MAT_VEC", "GTE_USE_OPENGL", "GTE_DISABLE_PCH")
  16. remove_headerfiles("GTE/Graphics/DX11/**.h")
  17. add_files("GTE/Graphics/GL46/**.cpp")
  18. remove_files("GTE/Graphics/DX11/**.cpp")
  19. remove_files("GTE/Graphics/GL46/WGL/**.cpp")
  20. else
  21. add_syslinks("d3d11", "d3dcompiler", "dxgi", "dxguid")
  22. add_defines("UNICODE", "_UNICODE", {public = true})
  23. set_pcxxheader("GTE/Graphics/GTGraphicsPCH.h")
  24. add_defines("GTE_USE_MSWINDOWS", "GTE_USE_ROW_MAJOR", "GTE_USE_MAT_VEC", "GTE_USE_DIRECTX")
  25. remove_headerfiles("GTE/Graphics/GL46/**.h")
  26. add_files("GTE/Graphics/DX11/**.cpp")
  27. remove_files("GTE/Graphics/GL46/**.cpp")
  28. end
  29. if is_plat("windows") and is_kind("shared") then
  30. add_rules("utils.symbols.export_all", {export_classes = true})
  31. end
  32. target("gtapplications")
  33. add_rules("utils.install.cmake_importfiles")
  34. set_kind("$(kind)")
  35. add_deps("gtgraphics", "gtmathematics")
  36. add_includedirs("GTE", {public = true})
  37. add_headerfiles("(GTE/Applications/**.h)")
  38. add_files("GTE/Applications/**.cpp")
  39. if is_plat("linux") then
  40. add_defines("GTE_USE_LINUX", "GTE_USE_ROW_MAJOR", "GTE_USE_MAT_VEC", "GTE_USE_OPENGL", "GTE_DISABLE_PCH")
  41. remove_headerfiles("GTE/Applications/MSW/**.h")
  42. add_files("GTE/Applications/GLX/**.cpp")
  43. remove_files("GTE/Applications/MSW/**.cpp")
  44. else
  45. add_syslinks("windowscodecs", "ole32", "oleaut32", "gdi32", "user32")
  46. add_defines("UNICODE", "_UNICODE", {public = true})
  47. set_pcxxheader("GTE/Applications/GTApplicationsPCH.h")
  48. add_defines("GTE_USE_MSWINDOWS", "GTE_USE_ROW_MAJOR", "GTE_USE_MAT_VEC", "GTE_USE_DIRECTX")
  49. remove_headerfiles("GTE/Applications/GLX/**.h")
  50. add_files("GTE/Applications/MSW/**.cpp")
  51. remove_files("GTE/Applications/GLX/**.cpp")
  52. end
  53. if is_plat("windows") and is_kind("shared") then
  54. add_rules("utils.symbols.export_all", {export_classes = true})
  55. end
  56. target("gtmathematicsgpu")
  57. add_rules("utils.install.cmake_importfiles")
  58. set_kind("$(kind)")
  59. add_deps("gtgraphics", "gtmathematics", "gtapplications")
  60. add_includedirs("GTE", {public = true})
  61. add_headerfiles("(GTE/MathematicsGPU/**.h)")
  62. add_files("GTE/MathematicsGPU/**.cpp")
  63. if is_plat("linux") then
  64. add_defines("GTE_USE_LINUX", "GTE_USE_ROW_MAJOR", "GTE_USE_MAT_VEC", "GTE_USE_OPENGL", "GTE_DISABLE_PCH")
  65. else
  66. add_defines("UNICODE", "_UNICODE", {public = true})
  67. add_defines("GTE_USE_MSWINDOWS", "GTE_USE_ROW_MAJOR", "GTE_USE_MAT_VEC", "GTE_USE_DIRECTX")
  68. set_pcxxheader("GTE/MathematicsGPU/GTMathematicsGPUPCH.h")
  69. end
  70. if is_plat("windows") and is_kind("shared") then
  71. add_rules("utils.symbols.export_all", {export_classes = true})
  72. end
  73. target("gtmathematics")
  74. add_rules("utils.install.cmake_importfiles")
  75. set_kind("headeronly")
  76. if not is_plat("linux") then
  77. add_defines("UNICODE", "_UNICODE", {public = true})
  78. end
  79. add_includedirs("GTE", {public = true})
  80. add_headerfiles("(GTE/Mathematics/**.h)")