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.

214 lines
8.1KB

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