genie.lua 2.3 KB

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