genie.lua 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. --
  2. -- Copyright 2010-2024 Branimir Karadzic. All rights reserved.
  3. -- License: https://github.com/bkaradzic/bx/blob/master/LICENSE
  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. BX_BUILD_DIR = path.join(BX_DIR, ".build")
  26. 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. BX_THIRD_PARTY_DIR,
  41. }
  42. defines {
  43. "CATCH_AMALGAMATED_CUSTOM_MAIN",
  44. }
  45. files {
  46. path.join(BX_DIR, "3rdparty/catch/catch_amalgamated.cpp"),
  47. path.join(BX_DIR, "tests/*_test.cpp"),
  48. path.join(BX_DIR, "tests/*.h"),
  49. path.join(BX_DIR, "tests/dbg.*"),
  50. }
  51. using_bx()
  52. configuration { "vs* or mingw*" }
  53. links {
  54. "psapi",
  55. }
  56. configuration { "android*" }
  57. targetextension ".so"
  58. linkoptions {
  59. "-shared",
  60. }
  61. configuration { "linux-*" }
  62. links {
  63. "pthread",
  64. }
  65. configuration { "osx*" }
  66. links {
  67. "Cocoa.framework",
  68. }
  69. configuration { "wasm" }
  70. buildoptions {
  71. "-fwasm-exceptions",
  72. }
  73. linkoptions {
  74. "-fwasm-exceptions",
  75. "-s STACK_SIZE=262144",
  76. }
  77. configuration {}
  78. strip()
  79. project "bx.bench"
  80. kind "ConsoleApp"
  81. debugdir (path.join(BX_DIR, "tests"))
  82. includedirs {
  83. path.join(BX_DIR, "include"),
  84. BX_THIRD_PARTY_DIR,
  85. }
  86. files {
  87. path.join(BX_DIR, "tests/*_bench.cpp"),
  88. path.join(BX_DIR, "tests/*_bench.h"),
  89. path.join(BX_DIR, "tests/dbg.*"),
  90. }
  91. links {
  92. "bx",
  93. }
  94. configuration { "vs* or mingw*" }
  95. links {
  96. "psapi",
  97. }
  98. configuration { "android*" }
  99. targetextension ".so"
  100. linkoptions {
  101. "-shared",
  102. }
  103. configuration { "linux-*" }
  104. links {
  105. "pthread",
  106. }
  107. configuration { "osx*" }
  108. links {
  109. "Cocoa.framework",
  110. }
  111. configuration { "Debug" }
  112. defines {
  113. "BX_CONFIG_DEBUG=1",
  114. }
  115. configuration { "Release" }
  116. defines {
  117. "BX_CONFIG_DEBUG=0",
  118. }
  119. configuration {}
  120. strip()