genie.lua 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. --
  2. -- Copyright 2010-2017 Branimir Karadzic. All rights reserved.
  3. -- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
  4. --
  5. newoption {
  6. trigger = "with-amalgamated",
  7. description = "Enable amalgamated build.",
  8. }
  9. newoption {
  10. trigger = "with-crtnone",
  11. description = "Enable build without CRT.",
  12. }
  13. solution "bx"
  14. configurations {
  15. "Debug",
  16. "Release",
  17. }
  18. platforms {
  19. "x32",
  20. "x64",
  21. "Native", -- for targets where bitness is not specified
  22. }
  23. language "C++"
  24. BX_DIR = path.getabsolute("..")
  25. local BX_BUILD_DIR = path.join(BX_DIR, ".build")
  26. local BX_THIRD_PARTY_DIR = path.join(BX_DIR, "3rdparty")
  27. dofile "toolchain.lua"
  28. toolchain(BX_BUILD_DIR, BX_THIRD_PARTY_DIR)
  29. function copyLib()
  30. end
  31. dofile "bx.lua"
  32. dofile "bin2c.lua"
  33. project "bx.test"
  34. kind "ConsoleApp"
  35. debugdir (path.join(BX_DIR, "tests"))
  36. removeflags {
  37. "NoExceptions",
  38. }
  39. includedirs {
  40. path.join(BX_DIR, "include"),
  41. BX_THIRD_PARTY_DIR,
  42. }
  43. files {
  44. path.join(BX_DIR, "tests/*_test.cpp"),
  45. path.join(BX_DIR, "tests/*.h"),
  46. path.join(BX_DIR, "tests/dbg.*"),
  47. }
  48. links {
  49. "bx",
  50. }
  51. configuration { "vs* or mingw*" }
  52. links {
  53. "psapi",
  54. }
  55. configuration { "android*" }
  56. targetextension ".so"
  57. linkoptions {
  58. "-shared",
  59. }
  60. configuration { "nacl or nacl-arm" }
  61. targetextension ".nexe"
  62. links {
  63. "ppapi",
  64. "pthread",
  65. }
  66. configuration { "pnacl" }
  67. targetextension ".pexe"
  68. links {
  69. "ppapi",
  70. "pthread",
  71. }
  72. configuration { "linux-*" }
  73. links {
  74. "pthread",
  75. }
  76. configuration { "osx" }
  77. links {
  78. "Cocoa.framework",
  79. }
  80. configuration {}
  81. strip()
  82. project "bx.bench"
  83. kind "ConsoleApp"
  84. debugdir (path.join(BX_DIR, "tests"))
  85. includedirs {
  86. path.join(BX_DIR, "include"),
  87. BX_THIRD_PARTY_DIR,
  88. }
  89. files {
  90. path.join(BX_DIR, "tests/*_bench.cpp"),
  91. path.join(BX_DIR, "tests/*_bench.h"),
  92. path.join(BX_DIR, "tests/dbg.*"),
  93. }
  94. links {
  95. "bx",
  96. }
  97. configuration { "vs* or mingw*" }
  98. links {
  99. "psapi",
  100. }
  101. configuration { "android*" }
  102. targetextension ".so"
  103. linkoptions {
  104. "-shared",
  105. }
  106. configuration { "nacl or nacl-arm" }
  107. targetextension ".nexe"
  108. links {
  109. "ppapi",
  110. "pthread",
  111. }
  112. configuration { "pnacl" }
  113. targetextension ".pexe"
  114. links {
  115. "ppapi",
  116. "pthread",
  117. }
  118. configuration { "linux-*" }
  119. links {
  120. "pthread",
  121. }
  122. configuration { "osx" }
  123. links {
  124. "Cocoa.framework",
  125. }
  126. configuration {}
  127. strip()