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.

222 lines
8.8KB

  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", "-Wall", "-pthread",
  15. "-DJUCE_APP_CONFIG_HEADER='<AppConfig.h>'",
  16. "-Wno-multichar", "-Wno-unused-but-set-variable", "-Wno-unused-function", "-Wno-strict-overflow",
  17. os.getenv("CXXFLAGS") }
  18. package.config["Release"].target = project.name
  19. package.config["Release"].objdir = "intermediate/Release"
  20. package.config["Release"].defines = { "NDEBUG=1" }
  21. package.config["Release"].buildoptions = { "-O3", "-fvisibility=hidden", "-fvisibility-inlines-hidden" }
  22. if (not (os.getenv("NOOPTIMIZATIONS") or os.getenv("LINUX_EMBED"))) then
  23. package.config["Release"].buildoptions = {
  24. package.config["Release"].buildoptions,
  25. "-mtune=generic", "-msse", "-msse2"
  26. }
  27. end
  28. if (not macosx) then
  29. package.config["Release"].buildoptions = { package.config["Release"].buildoptions, "-fdata-sections", "-ffunction-sections" }
  30. end
  31. package.config["Debug"].target = project.name .. "_debug"
  32. package.config["Debug"].objdir = "intermediate/Debug"
  33. package.config["Debug"].defines = { "DEBUG=1", "_DEBUG=1" }
  34. package.config["Debug"].buildoptions = { "-O0", "-ggdb" }
  35. if (windows) then
  36. package.defines = { "WINDOWS=1" }
  37. package.buildoptions = { package.buildoptions, "-fpermissive", "-std=c++0x" }
  38. elseif (macosx) then
  39. package.defines = { "MAC=1" }
  40. package.buildoptions = { package.buildoptions, "-ObjC++" }
  41. elseif (os.getenv("LINUX_EMBED")) then
  42. package.defines = { "LINUX=1" }
  43. package.buildoptions = { package.buildoptions, "-DJUCE_AUDIOPROCESSOR_NO_GUI=1", "-std=c++0x" }
  44. else
  45. package.defines = { "LINUX=1" }
  46. package.buildoptions = { package.buildoptions, "`pkg-config --cflags alsa freetype2 x11 xext`", "-std=c++0x" }
  47. end
  48. return package
  49. end
  50. --=======================================================================================--
  51. function make_plugin_project(name, spec)
  52. if (spec == "LV2") then
  53. project.name = name .. ".lv2/" .. name
  54. project.bindir = "../../../bin/lv2"
  55. elseif (spec == "VST") then
  56. project.name = name
  57. project.bindir = "../../../bin/vst"
  58. end
  59. project.libdir = project.bindir
  60. project.configs = { "Release", "Debug" }
  61. package = newpackage()
  62. package.name = project.name
  63. package.kind = "dll"
  64. package.language = "c++"
  65. if (spec == "LV2") then
  66. 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" }
  67. elseif (spec == "VST") then
  68. 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" }
  69. end
  70. package.target = project.name
  71. package.targetprefix = ""
  72. package.objdir = "intermediate"
  73. package.buildoptions = { "-Wall", "-Werror=deprecated-declarations", "-pthread",
  74. "-DJUCE_APP_CONFIG_HEADER='<AppConfig.h>'",
  75. os.getenv("CXXFLAGS") }
  76. package.links = {}
  77. package.linkoptions = { "-pthread", os.getenv("LDFLAGS") }
  78. package.config["Release"].target = project.name
  79. package.config["Release"].objdir = "intermediate/Release"
  80. package.config["Release"].defines = { "NDEBUG=1", "CONFIGURATION=\"Release\"" }
  81. package.config["Release"].buildoptions = { "-O3", "-ffast-math", "-fomit-frame-pointer", "-fvisibility=hidden", "-fvisibility-inlines-hidden" }
  82. package.config["Release"].links = {}
  83. if (not (os.getenv("NOOPTIMIZATIONS") or os.getenv("LINUX_EMBED"))) then
  84. package.config["Release"].buildoptions = {
  85. package.config["Release"].buildoptions,
  86. "-mtune=generic", "-msse", "-msse2", "-mfpmath=sse"
  87. }
  88. end
  89. if (not macosx) then
  90. package.linkoptions = { package.linkoptions, "-Wl,--no-undefined" }
  91. package.config["Release"].buildoptions = { package.config["Release"].buildoptions, "-fdata-sections", "-ffunction-sections" }
  92. package.config["Release"].linkoptions = { "-fdata-sections", "-ffunction-sections", "-Wl,--gc-sections", "-Wl,--strip-all" }
  93. end
  94. package.config["Debug"].target = project.name .. "_debug"
  95. package.config["Debug"].objdir = "intermediate/Debug"
  96. package.config["Debug"].defines = { "DEBUG=1", "_DEBUG=1", "CONFIGURATION=\"Debug\"" }
  97. package.config["Debug"].buildoptions = { "-O0", "-ggdb" }
  98. package.config["Debug"].links = {}
  99. package.includepaths = {
  100. "../source",
  101. "../../../libs/drowaudio/source",
  102. "../../../libs/juced/source",
  103. "../../../libs/juce-legacy/source",
  104. "../../../libs/juce-legacy/source/modules",
  105. "../../../libs/juce-plugin",
  106. "../../../libs/juce-plugin/juce-legacy"
  107. }
  108. package.libpaths = {
  109. "../../../libs"
  110. }
  111. if (windows) then
  112. package.defines = { package.defines, "WINDOWS=1", "BINTYPE=\"Windows-" .. spec .. "\"" }
  113. package.buildoptions = { package.buildoptions, "-fpermissive", "-std=c++0x" }
  114. elseif (macosx) then
  115. package.defines = { package.defines, "MAC=1", "BINTYPE=\"Mac-" .. spec .. "\"" }
  116. package.buildoptions = { package.buildoptions, "-ObjC++" }
  117. package.linkoptions = { package.linkoptions, "-dynamiclib" }
  118. package.targetextension = "dylib"
  119. else
  120. package.defines = { package.defines, "LINUX=1", "BINTYPE=\"Linux-" .. spec .. "\"" }
  121. package.buildoptions = { package.buildoptions, "-std=c++0x" }
  122. end
  123. if (os.getenv("LINUX_EMBED")) then
  124. package.buildoptions = { package.buildoptions, "-DJUCE_AUDIOPROCESSOR_NO_GUI=1" }
  125. end
  126. return package
  127. end
  128. --=======================================================================================--
  129. function make_juce_lv2_project(name)
  130. package = make_plugin_project(name, "LV2")
  131. package.config["Release"].links = { "juce-legacy" }
  132. package.config["Debug"].links = { "juce-legacy_debug" }
  133. if (windows) then
  134. package.links = { "comdlg32", "gdi32", "imm32", "ole32", "oleaut32", "shlwapi", "uuid", "version", "winmm", "wininet", "ws2_32" }
  135. elseif (macosx) then
  136. package.linkoptions = { package.linkoptions,
  137. "-framework Accelerate", "-framework AudioToolbox", "-framework AudioUnit", "-framework Carbon", "-framework Cocoa",
  138. "-framework CoreAudio", "-framework CoreAudioKit", "-framework CoreMIDI", "-framework IOKit", "-framework QuartzCore", "-framework WebKit" }
  139. elseif (os.getenv("LINUX_EMBED")) then
  140. package.links = { "dl", "rt" }
  141. else
  142. package.links = { "dl", "rt" }
  143. package.linkoptions = { package.linkoptions, "`pkg-config --libs freetype2 x11 xext`" }
  144. if (name == "drumsynth" or name == "eqinox" or name == "Dexed") then
  145. package.linkoptions = { package.linkoptions, "`pkg-config --libs alsa`" }
  146. else
  147. package.config["Debug"].linkoptions = { "`pkg-config --libs alsa`" }
  148. end
  149. end
  150. return package
  151. end
  152. function make_juce_vst_project(name)
  153. package = make_plugin_project(name, "VST")
  154. package.config["Release"].links = { "juce-legacy" }
  155. package.config["Debug"].links = { "juce-legacy_debug" }
  156. package.buildoptions = {
  157. package.buildoptions,
  158. "-Wno-multichar",
  159. "-Wno-write-strings"
  160. }
  161. package.includepaths = {
  162. package.includepaths,
  163. "../../../sdks/vstsdk2.4"
  164. }
  165. if (windows) then
  166. package.links = { "comdlg32", "gdi32", "imm32", "ole32", "oleaut32", "shlwapi", "uuid", "version", "winmm", "wininet", "ws2_32" }
  167. elseif (macosx) then
  168. package.linkoptions = { package.linkoptions,
  169. "-framework Accelerate", "-framework AudioToolbox", "-framework AudioUnit", "-framework Carbon", "-framework Cocoa",
  170. "-framework CoreAudio", "-framework CoreAudioKit", "-framework CoreMIDI", "-framework IOKit", "-framework QuartzCore", "-framework WebKit" }
  171. else
  172. package.links = { "dl", "rt" }
  173. package.linkoptions = { package.linkoptions, "`pkg-config --libs freetype2 x11 xext`" }
  174. if (name == "drumsynth" or name == "eqinox" or name == "Dexed") then
  175. package.linkoptions = { package.linkoptions, "`pkg-config --libs alsa`" }
  176. else
  177. package.config["Debug"].linkoptions = { "`pkg-config --libs alsa`" }
  178. end
  179. end
  180. return package
  181. end
  182. --=======================================================================================--