|
@@ -8,8 +8,35 @@ package("magnum")
|
|
|
"https://github.com/mosra/magnum.git")
|
|
|
add_versions("v2020.06", "98dfe802e56614e4e6bf750d9b693de46a5ed0c6eb479b0268f1a20bf34268bf")
|
|
|
|
|
|
- add_configs("audio", {description = "Build audio module.", default = false, type = "boolean"})
|
|
|
- add_configs("vulkan", {description = "Build vulkan module.", default = false, type = "boolean"})
|
|
|
+ add_configs("audio", {description = "Build audio module.", default = false, type = "boolean"})
|
|
|
+ add_configs("vulkan", {description = "Build vulkan module.", default = false, type = "boolean"})
|
|
|
+ add_configs("deprecated", {description = "Include deprecated APIs in the build.", default = true, type = "boolean"})
|
|
|
+ add_configs("plugin_static", {description = "Build plugins as static libraries.", default = false, type = "boolean"})
|
|
|
+
|
|
|
+ local applicationlibs = {"android", "emscripten", "glfw", "glx", "sdl2", "xegl", "windowlesscgl", "windowlessegl", "windowlessglx", "windowlessios", "windowlesswgl", "windowlesswindowsegl"}
|
|
|
+ for _, applicationlib in ipairs(applicationlibs) do
|
|
|
+ add_configs(applicationlib, {description = "Build the " .. applicationlib .. " application library.", default = false, type = "boolean"})
|
|
|
+ end
|
|
|
+
|
|
|
+ local contexts = {"cgl", "egl", "glx", "wgl"}
|
|
|
+ for _, context in ipairs(contexts) do
|
|
|
+ add_configs(context .. "context", {description = "Build the " .. context .. " context handling library.", default = false, type = "boolean"})
|
|
|
+ end
|
|
|
+
|
|
|
+ local testers = {"opengltester", "vulkantester"}
|
|
|
+ for _, tester in ipairs(testers) do
|
|
|
+ add_configs(tester, {description = "Build the " .. tester .. " class.", default = false, type = "boolean"})
|
|
|
+ end
|
|
|
+
|
|
|
+ local plugins = {"anyaudioimporter", "anyimageconverter", "anyimageimporter", "anysceneconverter", "anysceneimporter", "anyshaderconverter", "magnumfont", "magnumfontconverter", "objimporter", "tgaimporter", "tgaimageconverter", "wavaudioimporter"}
|
|
|
+ for _, plugin in ipairs(plugins) do
|
|
|
+ add_configs(plugin, {description = "Build the " .. plugin .. " plugin.", default = false, type = "boolean"})
|
|
|
+ end
|
|
|
+
|
|
|
+ local utilities = {"gl_info", "vk_info", "al_info", "distancefieldconverter", "fontconverter", "imageconverter", "sceneconverter", "shaderconverter"}
|
|
|
+ for _, utility in ipairs(utilities) do
|
|
|
+ add_configs(utility, {description = "Build the " .. utility .. " executable.", default = false, type = "boolean"})
|
|
|
+ end
|
|
|
|
|
|
add_deps("cmake", "corrade", "opengl")
|
|
|
add_links("MagnumAudio", "MagnumDebugTools", "MagnumGL", "MagnumMeshTools", "MagnumPrimitives", "MagnumSceneGraph", "MagnumShaders", "MagnumText", "MagnumTextureTools", "MagnumTrade", "MagnumVk", "Magnum")
|
|
@@ -20,6 +47,15 @@ package("magnum")
|
|
|
if package:config("vulkan") then
|
|
|
package:add("deps", "vulkansdk")
|
|
|
end
|
|
|
+ if package:config("glfw") then
|
|
|
+ package:add("deps", "glfw")
|
|
|
+ end
|
|
|
+ if package:config("sdl2") then
|
|
|
+ package:add("deps", "libsdl")
|
|
|
+ end
|
|
|
+ if package:config("glx") then
|
|
|
+ package:add("deps", "libx11")
|
|
|
+ end
|
|
|
end)
|
|
|
|
|
|
on_install("windows", "linux", "macosx", function (package)
|
|
@@ -28,6 +64,23 @@ package("magnum")
|
|
|
table.insert(configs, "-DBUILD_STATIC=" .. (package:config("shared") and "OFF" or "ON"))
|
|
|
table.insert(configs, "-DWITH_AUDIO=" .. (package:config("audio") and "ON" or "OFF"))
|
|
|
table.insert(configs, "-DWITH_VK=" .. (package:config("vulkan") and "ON" or "OFF"))
|
|
|
+ table.insert(configs, "-DBUILD_DEPRECATED=" .. (package:config("deprecated") and "ON" or "OFF"))
|
|
|
+ table.insert(configs, "-DBUILD_PLUGIN_STATIC=" .. (package:config("plugin_static") and "ON" or "OFF"))
|
|
|
+ for _, applicationlib in ipairs(applicationlibs) do
|
|
|
+ table.insert(configs, "-DWITH_" .. applicationlib:upper() .. "APPLICATION=" .. (package:config(applicationlib) and "ON" or "OFF"))
|
|
|
+ end
|
|
|
+ for _, context in ipairs(contexts) do
|
|
|
+ table.insert(configs, "-DWITH_" .. context:upper() .. "CONTEXT=" .. (package:config(context) and "ON" or "OFF"))
|
|
|
+ end
|
|
|
+ for _, tester in ipairs(testers) do
|
|
|
+ table.insert(configs, "-DWITH_" .. tester:upper() .. "=" .. (package:config(tester) and "ON" or "OFF"))
|
|
|
+ end
|
|
|
+ for _, plugin in ipairs(plugins) do
|
|
|
+ table.insert(configs, "-DWITH_" .. plugin:upper() .. "=" .. (package:config(plugin) and "ON" or "OFF"))
|
|
|
+ end
|
|
|
+ for _, utility in ipairs(utilities) do
|
|
|
+ table.insert(configs, "-DWITH_" .. utility:upper() .. "=" .. (package:config(utility) and "ON" or "OFF"))
|
|
|
+ end
|
|
|
import("package.tools.cmake").install(package, configs, {buildir = os.tmpdir()})
|
|
|
end)
|
|
|
|