hpr-cpp/source/xmake.lua
2024-03-14 15:57:16 +05:00

65 lines
1.5 KiB
Lua

-- options: general
option("creator")
set_category("General")
set_default(false)
set_showmenu(true)
set_description("Build creator application")
option_end()
option("tests")
set_category("General")
set_default(false)
set_showmenu(true)
set_description("Build tests")
option_end()
-- options: modules
for _, name in ipairs({"csg", "mesh"}) do
option(name)
set_category("Modules")
set_default(true)
set_showmenu(true)
set_description(format("Module %s", name))
set_configvar("HPR_HAVE_MODULE_" .. name:upper(), 1)
option_end()
end
-- packages
add_requires("imgui v1.90-docking")
add_requires("implot v0.15")
add_requires("glfw 3.3.8")
if has_config("csg") then
add_requires("pacman::opencascade 7.7.2", {alias = "opencascade"})
end
if has_config("tests") then
add_requires("gtest")
end
--
option("scalar_implementation")
set_category("Internal")
set_default(true)
set_description("Use internal scalar implementation")
add_defines("HPR_SCALAR_IMPLEMENTATION")
option_end()
option("scalar")
set_category("Internal")
set_values("float", "double", "long double")
set_default("float")
set_description("Internal scalar value type")
after_check(function(option)
option:add("defines", format("HPR_SCALAR=%s", option:value()))
end)
option_end()
-- includes project dirs
includes("hpr")
if has_config("creator") then
includes("creator")
end