genie.lua 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. defines {
  28. "BX_CONFIG_ENABLE_MSVC_LEVEL4_WARNINGS=1"
  29. }
  30. dofile "toolchain.lua"
  31. toolchain(BX_BUILD_DIR, BX_THIRD_PARTY_DIR)
  32. function copyLib()
  33. end
  34. dofile "bx.lua"
  35. dofile "bin2c.lua"
  36. project "bx.test"
  37. kind "ConsoleApp"
  38. debugdir (path.join(BX_DIR, "tests"))
  39. removeflags {
  40. "NoExceptions",
  41. }
  42. includedirs {
  43. path.join(BX_DIR, "include"),
  44. BX_THIRD_PARTY_DIR,
  45. }
  46. files {
  47. path.join(BX_DIR, "tests/*_test.cpp"),
  48. path.join(BX_DIR, "tests/*.h"),
  49. path.join(BX_DIR, "tests/dbg.*"),
  50. }
  51. links {
  52. "bx",
  53. }
  54. configuration { "vs* or mingw*" }
  55. links {
  56. "psapi",
  57. }
  58. configuration { "android*" }
  59. targetextension ".so"
  60. linkoptions {
  61. "-shared",
  62. }
  63. configuration { "nacl or nacl-arm" }
  64. targetextension ".nexe"
  65. links {
  66. "ppapi",
  67. "pthread",
  68. }
  69. configuration { "pnacl" }
  70. targetextension ".pexe"
  71. links {
  72. "ppapi",
  73. "pthread",
  74. }
  75. configuration { "linux-*" }
  76. links {
  77. "pthread",
  78. }
  79. configuration { "osx" }
  80. links {
  81. "Cocoa.framework",
  82. }
  83. configuration {}
  84. strip()
  85. project "bx.bench"
  86. kind "ConsoleApp"
  87. debugdir (path.join(BX_DIR, "tests"))
  88. includedirs {
  89. path.join(BX_DIR, "include"),
  90. BX_THIRD_PARTY_DIR,
  91. }
  92. files {
  93. path.join(BX_DIR, "tests/*_bench.cpp"),
  94. path.join(BX_DIR, "tests/*_bench.h"),
  95. path.join(BX_DIR, "tests/dbg.*"),
  96. }
  97. links {
  98. "bx",
  99. }
  100. configuration { "vs* or mingw*" }
  101. links {
  102. "psapi",
  103. }
  104. configuration { "android*" }
  105. targetextension ".so"
  106. linkoptions {
  107. "-shared",
  108. }
  109. configuration { "nacl or nacl-arm" }
  110. targetextension ".nexe"
  111. links {
  112. "ppapi",
  113. "pthread",
  114. }
  115. configuration { "pnacl" }
  116. targetextension ".pexe"
  117. links {
  118. "ppapi",
  119. "pthread",
  120. }
  121. configuration { "linux-*" }
  122. links {
  123. "pthread",
  124. }
  125. configuration { "osx" }
  126. links {
  127. "Cocoa.framework",
  128. }
  129. configuration {}
  130. strip()