You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

307 lines
10KB

  1. --=======================================================================================--
  2. function make_library_project(name)
  3. project.name = name
  4. project.bindir = "../.."
  5. project.libdir = project.bindir
  6. project.configs = { "Release", "Debug" }
  7. package = newpackage()
  8. package.name = project.name
  9. package.kind = "lib"
  10. package.language = "c++"
  11. package.target = project.name
  12. package.objdir = "intermediate"
  13. package.defines = {}
  14. package.buildoptions = { "-fPIC", "-DPIC", os.getenv("CXXFLAGS") }
  15. package.config["Release"].target = project.name
  16. package.config["Release"].objdir = "intermediate/Release"
  17. package.config["Release"].defines = { "NDEBUG=1" }
  18. package.config["Release"].buildoptions = { "-O3", "-ffast-math", "-fomit-frame-pointer", "-mtune=generic", "-msse", "-msse2", "-mfpmath=sse", "-fvisibility=hidden", "-fvisibility-inlines-hidden" }
  19. if (not macosx) then
  20. package.config["Release"].buildoptions = { package.config["Release"].buildoptions, "-fdata-sections", "-ffunction-sections" }
  21. end
  22. package.config["Debug"].target = project.name .. "_debug"
  23. package.config["Debug"].objdir = "intermediate/Debug"
  24. package.config["Debug"].defines = { "DEBUG=1", "_DEBUG=1" }
  25. package.config["Debug"].buildoptions = { "-O0", "-ggdb" }
  26. if (windows) then
  27. package.defines = { "WINDOWS=1" }
  28. package.buildoptions = { package.buildoptions, "-fpermissive", "-std=c++0x" }
  29. elseif (macosx) then
  30. package.defines = { "MAC=1" }
  31. package.buildoptions = { package.buildoptions, "-ObjC++" }
  32. else
  33. package.defines = { "LINUX=1" }
  34. package.buildoptions = { package.buildoptions, "`pkg-config --cflags freetype2 x11 xext`", "-std=c++0x" }
  35. end
  36. return package
  37. end
  38. --=======================================================================================--
  39. function make_plugin_project(name, spec)
  40. if (spec == "LADSPA") then
  41. project.name = name
  42. project.bindir = "../../../bin/ladspa"
  43. elseif (spec == "DSSI") then
  44. project.name = name
  45. project.bindir = "../../../bin/dssi"
  46. elseif (spec == "LV2") then
  47. project.name = name .. ".lv2/" .. name
  48. project.bindir = "../../../bin/lv2"
  49. elseif (spec == "VST") then
  50. project.name = name
  51. project.bindir = "../../../bin/vst"
  52. end
  53. project.libdir = project.bindir
  54. project.configs = { "Release", "Debug" }
  55. package = newpackage()
  56. package.name = project.name
  57. package.kind = "dll"
  58. package.language = "c++"
  59. if (spec == "LADSPA") then
  60. package.defines = { "DISTRHO_PLUGIN_TARGET_LADSPA=1" }
  61. elseif (spec == "DSSI") then
  62. package.defines = { "DISTRHO_PLUGIN_TARGET_DSSI=1" }
  63. elseif (spec == "LV2") then
  64. package.defines = { "DISTRHO_PLUGIN_TARGET_LV2=1", "JucePlugin_Build_AU=0", "JucePlugin_Build_LV2=1", "JucePlugin_Build_RTAS=0", "JucePlugin_Build_VST=0", "JucePlugin_Build_Standalone=0" }
  65. elseif (spec == "VST") then
  66. package.defines = { "DISTRHO_PLUGIN_TARGET_VST=1", "JucePlugin_Build_AU=0", "JucePlugin_Build_LV2=0", "JucePlugin_Build_RTAS=0", "JucePlugin_Build_VST=1", "JucePlugin_Build_Standalone=0" }
  67. end
  68. package.target = project.name
  69. package.targetprefix = ""
  70. package.objdir = "intermediate"
  71. package.buildoptions = { os.getenv("CXXFLAGS") }
  72. package.links = {}
  73. package.linkoptions = { os.getenv("LDFLAGS") }
  74. package.config["Release"].target = project.name
  75. package.config["Release"].objdir = "intermediate/Release"
  76. package.config["Release"].defines = { "NDEBUG=1", "CONFIGURATION=\"Release\"" }
  77. package.config["Release"].buildoptions = { "-O3", "-ffast-math", "-fomit-frame-pointer", "-mtune=generic", "-msse", "-msse2", "-mfpmath=sse", "-fvisibility=hidden", "-fvisibility-inlines-hidden" }
  78. package.config["Release"].links = {}
  79. if (not macosx) then
  80. package.linkoptions = { package.linkoptions, "-Wl,--no-undefined" }
  81. package.config["Release"].buildoptions = { package.config["Release"].buildoptions, "-fdata-sections", "-ffunction-sections" }
  82. package.config["Release"].linkoptions = { "-Wl,--gc-sections", "-Wl,--strip-all" }
  83. end
  84. package.config["Debug"].target = project.name .. "_debug"
  85. package.config["Debug"].objdir = "intermediate/Debug"
  86. package.config["Debug"].defines = { "DEBUG=1", "_DEBUG=1", "CONFIGURATION=\"Debug\"" }
  87. package.config["Debug"].buildoptions = { "-O0", "-ggdb" }
  88. package.config["Debug"].links = {}
  89. package.includepaths = {
  90. "../source"
  91. }
  92. package.libpaths = {
  93. "../../../libs"
  94. }
  95. if (windows) then
  96. package.defines = { package.defines, "WINDOWS=1", "BINTYPE=\"Windows-" .. spec .. "\"" }
  97. package.buildoptions = { package.buildoptions, "-fpermissive", "-std=c++0x" }
  98. elseif (macosx) then
  99. package.defines = { package.defines, "MAC=1", "BINTYPE=\"Mac-" .. spec .. "\"" }
  100. package.buildoptions = { package.buildoptions, "-ObjC++" }
  101. package.linkoptions = { package.linkoptions, "-dynamiclib" }
  102. package.targetextension = "dylib"
  103. else
  104. package.defines = { package.defines, "LINUX=1", "BINTYPE=\"Linux-" .. spec .. "\"" }
  105. package.buildoptions = { package.buildoptions, "-std=c++0x" }
  106. end
  107. return package
  108. end
  109. --=======================================================================================--
  110. function make_distrho_ladspa_project(name)
  111. package = make_plugin_project(name, "LADSPA")
  112. package.includepaths = {
  113. package.includepaths,
  114. "../../../libs/distrho"
  115. }
  116. return package
  117. end
  118. function make_distrho_dssi_project(name)
  119. package = make_plugin_project(name, "DSSI")
  120. package.includepaths = {
  121. package.includepaths,
  122. "../../../libs/distrho"
  123. }
  124. return package
  125. end
  126. function make_distrho_dssi_ui_project(name)
  127. package = make_plugin_project(name, "DSSI")
  128. project.name = project.name .. "/" .. project.name .. "_gl"
  129. package.kind = "exe"
  130. package.buildoptions = { package.buildoptions, "`pkg-config --cflags liblo`" }
  131. package.linkoptions = { package.linkoptions, "`pkg-config --libs liblo`" }
  132. package.config["Release"].links = { "dgl" }
  133. package.config["Release"].target = project.name
  134. package.config["Debug"].links = { "dgl_debug" }
  135. package.config["Debug"].target = project.name .. "Debug"
  136. package.includepaths = {
  137. package.includepaths,
  138. "../../../libs/distrho",
  139. "../../../libs/dgl"
  140. }
  141. if (windows) then
  142. package.links = { "opengl32", "gdi32" }
  143. elseif (macosx) then
  144. package.linkoptions = { package.linkoptions, "-framework OpenGL", "-framework Cocoa" }
  145. else
  146. package.linkoptions = { package.linkoptions, "`pkg-config --libs gl x11`" }
  147. end
  148. return package
  149. end
  150. function make_distrho_lv2_project(name)
  151. package = make_plugin_project(name, "LV2")
  152. package.includepaths = { package.includepaths, "../../../libs/distrho" }
  153. return package
  154. end
  155. function make_distrho_lv2_ui_project(name)
  156. package = make_plugin_project(name, "LV2")
  157. project.name = name .. ".lv2/" .. name .. "_ui"
  158. package.config["Release"].links = { "dgl" }
  159. package.config["Release"].target = project.name
  160. package.config["Debug"].links = { "dgl_debug" }
  161. package.config["Debug"].target = name .. ".lv2/" .. name .. "_debug_ui"
  162. package.includepaths = {
  163. package.includepaths,
  164. "../../../libs/distrho",
  165. "../../../libs/dgl"
  166. }
  167. if (windows) then
  168. package.links = { "opengl32", "gdi32" }
  169. elseif (macosx) then
  170. package.linkoptions = { package.linkoptions, "-framework OpenGL", "-framework Cocoa" }
  171. else
  172. package.linkoptions = { package.linkoptions, "`pkg-config --libs gl x11`" }
  173. end
  174. return package
  175. end
  176. function make_distrho_vst_project(name)
  177. package = make_plugin_project(name, "VST")
  178. package.config["Release"].links = { "dgl" }
  179. package.config["Debug"].links = { "dgl_debug" }
  180. package.includepaths = {
  181. package.includepaths,
  182. "../../../libs/distrho",
  183. "../../../libs/dgl"
  184. }
  185. if (windows) then
  186. package.links = { "opengl32", "gdi32" }
  187. elseif (macosx) then
  188. package.linkoptions = { package.linkoptions, "-framework OpenGL", "-framework Cocoa" }
  189. else
  190. package.linkoptions = { package.linkoptions, "`pkg-config --libs gl x11`" }
  191. end
  192. return package
  193. end
  194. --=======================================================================================--
  195. function make_juce_lv2_project(name)
  196. package = make_plugin_project(name, "LV2")
  197. package.config["Release"].links = { "juce" }
  198. package.config["Debug"].links = { "juce_debug" }
  199. package.includepaths = {
  200. package.includepaths,
  201. "../../../libs/juce/source",
  202. "../../../libs/drowaudio/source",
  203. "../../../libs/juced/source",
  204. "../../../libs/juce-plugin"
  205. }
  206. if (windows) then
  207. package.links = { "comdlg32", "gdi32", "imm32", "ole32", "oleaut32", "shlwapi", "uuid", "version", "winmm", "wininet", "ws2_32" }
  208. elseif (macosx) then
  209. package.linkoptions = { package.linkoptions,
  210. "-framework Accelerate", "-framework AudioToolbox", "-framework AudioUnit", "-framework Carbon", "-framework Cocoa",
  211. "-framework CoreAudio", "-framework CoreMIDI", "-framework IOKit", "-framework QuartzCore", "-framework WebKit" }
  212. else
  213. package.links = { "dl", "pthread", "rt" }
  214. package.linkoptions = { package.linkoptions, "`pkg-config --libs freetype2 x11 xext`" }
  215. end
  216. return package
  217. end
  218. function make_juce_vst_project(name)
  219. package = make_plugin_project(name, "VST")
  220. package.config["Release"].links = { "juce" }
  221. package.config["Debug"].links = { "juce_debug" }
  222. package.includepaths = {
  223. package.includepaths,
  224. "../../../libs/juce/source",
  225. "../../../libs/drowaudio/source",
  226. "../../../libs/juced/source",
  227. "../../../libs/juce-plugin",
  228. "../../../sdks/vstsdk2.4"
  229. }
  230. if (windows) then
  231. package.links = { "comdlg32", "gdi32", "imm32", "ole32", "oleaut32", "shlwapi", "uuid", "version", "winmm", "wininet", "ws2_32" }
  232. elseif (macosx) then
  233. package.linkoptions = { package.linkoptions,
  234. "-framework Accelerate", "-framework AudioToolbox", "-framework AudioUnit", "-framework Carbon", "-framework Cocoa",
  235. "-framework CoreAudio", "-framework CoreMIDI", "-framework IOKit", "-framework QuartzCore", "-framework WebKit" }
  236. else
  237. package.links = { "dl", "pthread", "rt" }
  238. package.linkoptions = { package.linkoptions, "`pkg-config --libs freetype2 x11 xext`" }
  239. end
  240. return package
  241. end
  242. --=======================================================================================--