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.

221 lines
8.7KB

  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/juce/source",
  102. "../../../libs/juce/source/modules",
  103. "../../../libs/drowaudio/source",
  104. "../../../libs/juced/source",
  105. "../../../libs/juce-plugin"
  106. }
  107. package.libpaths = {
  108. "../../../libs"
  109. }
  110. if (windows) then
  111. package.defines = { package.defines, "WINDOWS=1", "BINTYPE=\"Windows-" .. spec .. "\"" }
  112. package.buildoptions = { package.buildoptions, "-fpermissive", "-std=c++0x" }
  113. elseif (macosx) then
  114. package.defines = { package.defines, "MAC=1", "BINTYPE=\"Mac-" .. spec .. "\"" }
  115. package.buildoptions = { package.buildoptions, "-ObjC++" }
  116. package.linkoptions = { package.linkoptions, "-dynamiclib" }
  117. package.targetextension = "dylib"
  118. else
  119. package.defines = { package.defines, "LINUX=1", "BINTYPE=\"Linux-" .. spec .. "\"" }
  120. package.buildoptions = { package.buildoptions, "-std=c++0x" }
  121. end
  122. if (os.getenv("LINUX_EMBED")) then
  123. package.buildoptions = { package.buildoptions, "-DJUCE_AUDIOPROCESSOR_NO_GUI=1" }
  124. end
  125. return package
  126. end
  127. --=======================================================================================--
  128. function make_juce_lv2_project(name)
  129. package = make_plugin_project(name, "LV2")
  130. package.config["Release"].links = { "juce" }
  131. package.config["Debug"].links = { "juce_debug" }
  132. if (windows) then
  133. package.links = { "comdlg32", "gdi32", "imm32", "ole32", "oleaut32", "shlwapi", "uuid", "version", "winmm", "wininet", "ws2_32" }
  134. elseif (macosx) then
  135. package.linkoptions = { package.linkoptions,
  136. "-framework Accelerate", "-framework AudioToolbox", "-framework AudioUnit", "-framework Carbon", "-framework Cocoa",
  137. "-framework CoreAudio", "-framework CoreAudioKit", "-framework CoreMIDI", "-framework IOKit", "-framework QuartzCore", "-framework WebKit" }
  138. elseif (os.getenv("LINUX_EMBED")) then
  139. package.links = { "dl", "rt" }
  140. else
  141. package.links = { "dl", "rt" }
  142. package.linkoptions = { package.linkoptions, "`pkg-config --libs freetype2 x11 xext`" }
  143. if (name == "drumsynth" or name == "eqinox" or name == "Dexed") then
  144. package.linkoptions = { package.linkoptions, "`pkg-config --libs alsa`" }
  145. else
  146. package.config["Debug"].linkoptions = { "`pkg-config --libs alsa`" }
  147. end
  148. end
  149. return package
  150. end
  151. function make_juce_vst_project(name)
  152. package = make_plugin_project(name, "VST")
  153. package.config["Release"].links = { "juce" }
  154. package.config["Debug"].links = { "juce_debug" }
  155. package.buildoptions = {
  156. package.buildoptions,
  157. "-Wno-multichar",
  158. "-Wno-write-strings"
  159. }
  160. package.includepaths = {
  161. package.includepaths,
  162. "../../../sdks/vstsdk2.4"
  163. }
  164. if (windows) then
  165. package.links = { "comdlg32", "gdi32", "imm32", "ole32", "oleaut32", "shlwapi", "uuid", "version", "winmm", "wininet", "ws2_32" }
  166. elseif (macosx) then
  167. package.linkoptions = { package.linkoptions,
  168. "-framework Accelerate", "-framework AudioToolbox", "-framework AudioUnit", "-framework Carbon", "-framework Cocoa",
  169. "-framework CoreAudio", "-framework CoreAudioKit", "-framework CoreMIDI", "-framework IOKit", "-framework QuartzCore", "-framework WebKit" }
  170. else
  171. package.links = { "dl", "rt" }
  172. package.linkoptions = { package.linkoptions, "`pkg-config --libs freetype2 x11 xext`" }
  173. if (name == "drumsynth" or name == "eqinox" or name == "Dexed") then
  174. package.linkoptions = { package.linkoptions, "`pkg-config --libs alsa`" }
  175. else
  176. package.config["Debug"].linkoptions = { "`pkg-config --libs alsa`" }
  177. end
  178. end
  179. return package
  180. end
  181. --=======================================================================================--