2
0

openal.lua 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. --
  2. -- Copyright (c) 2012-2025 Daniele Bartolini et al.
  3. -- SPDX-License-Identifier: MIT
  4. --
  5. function openal_project(_kind)
  6. project "openal"
  7. kind (_kind)
  8. configuration {}
  9. local AL_DIR = (CROWN_DIR .. "3rdparty/openal/")
  10. removeflags {
  11. "Cpp20"
  12. }
  13. flags {
  14. "Cpp14"
  15. }
  16. defines {
  17. "AL_ALEXT_PROTOTYPES",
  18. "HAVE_MALLOC_H",
  19. "HAVE_STAT",
  20. "SIZEOF_LONG_LONG=8",
  21. }
  22. configuration { "not vs*" }
  23. defines {
  24. "HAVE_DIRENT_H",
  25. "HAVE_PTHREAD_SETNAME_NP",
  26. "HAVE_PTHREAD_SETSCHEDPARAM",
  27. "restrict=__restrict",
  28. "SIZEOF_LONG=8",
  29. }
  30. buildoptions {
  31. "-fPIC",
  32. "-fvisibility=hidden",
  33. "-fexceptions" -- :(
  34. }
  35. configuration { "android-* or linux-*" }
  36. defines {
  37. "HAVE_DLFCN_H",
  38. "HAVE_GCC_GET_CPUID",
  39. }
  40. links {
  41. "pthread",
  42. }
  43. configuration { "not android-*" }
  44. defines {
  45. "HAVE_SSE",
  46. "HAVE_SSE2",
  47. }
  48. files {
  49. AL_DIR .. "alc/mixer/mixer_sse2.cpp",
  50. AL_DIR .. "alc/mixer/mixer_sse.cpp",
  51. }
  52. configuration { "android-*" }
  53. defines {
  54. "HAVE_NEON",
  55. "HAVE_OPENSL",
  56. }
  57. files {
  58. AL_DIR .. "alc/mixer/mixer_neon.cpp",
  59. AL_DIR .. "alc/backends/opensl.cpp",
  60. }
  61. configuration { "linux-*" }
  62. defines {
  63. "HAVE_CPUID_H",
  64. "HAVE_POSIX_MEMALIGN",
  65. "HAVE_PULSEAUDIO",
  66. }
  67. files {
  68. AL_DIR .. "alc/backends/pulseaudio.cpp",
  69. }
  70. configuration { "vs* or mingw-*"}
  71. defines {
  72. "_WIN32_WINNT=0x0502",
  73. "_WINDOWS",
  74. "HAVE__ALIGNED_MALLOC",
  75. "HAVE_CPUID_INTRINSIC",
  76. "HAVE_DSOUND",
  77. "HAVE_GUIDDEF_H",
  78. "HAVE_INTRIN_H",
  79. "HAVE_WASAPI",
  80. "HAVE_WINDOWS_H",
  81. "HAVE_WINMM",
  82. "strcasecmp=_stricmp",
  83. "strncasecmp=_strnicmp",
  84. }
  85. files {
  86. AL_DIR .. "alc/backends/dsound.cpp",
  87. AL_DIR .. "alc/backends/wasapi.cpp",
  88. AL_DIR .. "alc/backends/winmm.cpp",
  89. }
  90. links {
  91. "winmm",
  92. "ole32",
  93. }
  94. configuration { "vs*" }
  95. defines {
  96. "_CRT_NONSTDC_NO_DEPRECATE",
  97. "restrict=",
  98. "SIZEOF_LONG=4",
  99. }
  100. buildoptions {
  101. "/wd4098",
  102. "/wd4267",
  103. "/wd4244",
  104. "/EHs", -- :(
  105. }
  106. configuration {}
  107. includedirs {
  108. AL_DIR .. "include",
  109. AL_DIR,
  110. AL_DIR .. "alc",
  111. AL_DIR .. "common",
  112. }
  113. files {
  114. AL_DIR .. "al/*.cpp",
  115. AL_DIR .. "alc/*.cpp",
  116. AL_DIR .. "alc/backends/base.cpp",
  117. AL_DIR .. "alc/backends/loopback.cpp",
  118. AL_DIR .. "alc/backends/null.cpp",
  119. AL_DIR .. "alc/effects/*.cpp",
  120. AL_DIR .. "alc/filters/*.cpp",
  121. AL_DIR .. "alc/midi/*.cpp",
  122. AL_DIR .. "alc/mixer/mixer_c.cpp",
  123. AL_DIR .. "common/*.cpp",
  124. }
  125. configuration {}
  126. end