tools.lua 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. --
  2. -- Copyright (c) 2012-2017 Daniele Bartolini and individual contributors.
  3. -- License: https://github.com/taylor001/crown/blob/master/LICENSE
  4. --
  5. solution "tools"
  6. language "Vala"
  7. configurations {
  8. "debug",
  9. "release",
  10. }
  11. local CROWN_DIR = (path.getabsolute("..") .. "/")
  12. local CROWN_BUILD_DIR = (CROWN_DIR .. "build/")
  13. local CROWN_TOOLS_DIR = (CROWN_BUILD_DIR .. "tools/")
  14. newoption
  15. {
  16. trigger = "compiler",
  17. value = "COMPILER",
  18. description = "Choose compiler",
  19. allowed =
  20. {
  21. { "linux-gcc", "Linux (GCC compiler)" },
  22. { "mingw", "MinGW" },
  23. }
  24. }
  25. if _ACTION == "gmake" then
  26. if nil == _OPTIONS["compiler"] then
  27. print("Choose a compiler!")
  28. os.exit(1)
  29. end
  30. if "linux-gcc" == _OPTIONS["compiler"] then
  31. if not os.is("linux") then
  32. print("Action not valid in current OS.")
  33. end
  34. location(CROWN_TOOLS_DIR .. "projects/" .. "linux")
  35. elseif "mingw" == _OPTIONS["compiler"] then
  36. location(CROWN_TOOLS_DIR .. "projects/" .. "mingw")
  37. end
  38. else
  39. print("Invalid action.")
  40. os.exit(1)
  41. end
  42. -- FIXME: Fix this in GENie
  43. premake.valac.valac = premake.valac.valac .. " --gresources=" .. CROWN_DIR .. "tools/ui/resources.xml" .. " --target-glib=2.38"
  44. configuration { "linux-*" }
  45. targetdir (CROWN_TOOLS_DIR .. "linux64" .. "/bin")
  46. objdir (CROWN_TOOLS_DIR .. "linux64" .. "/obj")
  47. configuration { "mingw" }
  48. targetdir (CROWN_TOOLS_DIR .. "mingw64" .. "/bin")
  49. objdir (CROWN_TOOLS_DIR .. "mingw64" .. "/obj")
  50. configuration { "debug" }
  51. targetsuffix "-debug64"
  52. configuration { "release" }
  53. targetsuffix "-release64"
  54. project "level-editor"
  55. kind "ConsoleApp"
  56. configuration { "debug" }
  57. flags {
  58. "Symbols",
  59. }
  60. defines {
  61. "CROWN_DEBUG",
  62. }
  63. configuration { "release" }
  64. flags {
  65. "Optimize"
  66. }
  67. configuration { "linux" }
  68. defines {
  69. "CROWN_PLATFORM_LINUX"
  70. }
  71. configuration { "windows" }
  72. defines {
  73. "CROWN_PLATFORM_WINDOWS"
  74. }
  75. configuration {}
  76. links {
  77. "gdk-3.0",
  78. "gee-0.8",
  79. "gio-2.0",
  80. "glib-2.0",
  81. "gtk+-3.0",
  82. "posix",
  83. }
  84. buildoptions {
  85. "-lm",
  86. "-Wno-deprecated-declarations",
  87. "-Wno-incompatible-pointer-types",
  88. "-Wno-discarded-qualifiers",
  89. }
  90. files {
  91. CROWN_DIR .. "tools/**.vala",
  92. CROWN_DIR .. "tools/ui/resources.c",
  93. }
  94. configuration {}