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.

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