Skip to content

Commit

Permalink
build: add version match deps
Browse files Browse the repository at this point in the history
  • Loading branch information
futrime committed Dec 25, 2023
1 parent f5f4895 commit f62dc33
Showing 1 changed file with 38 additions and 22 deletions.
60 changes: 38 additions & 22 deletions xmake.lua
Original file line number Diff line number Diff line change
@@ -1,33 +1,50 @@
add_repositories("liteldev-repo https://github.com/LiteLDev/xmake-repo.git")

add_requires("levilamina develop")
add_requires("levilamina 0.2.1")

if not has_config("vs_runtime") then
set_runtimes("MD")
end

package("levilamina")
add_urls("https://github.com/LiteLDev/LeviLamina.git")
add_urls("https://github.com/LiteLDev/LeviLamina/releases/download/v$(version)/levilamina-windows-x64.zip")
add_versions("0.2.1", "995a6979ea2e42f597c34dfa06ffe273909eab84a55943e51ffceb4ce39e82ad")

-- Dependencies from xmake-repo.
add_deps("entt 3.12.2")
add_deps("fmt 10.1.1")
add_deps("gsl 4.0.0")
add_deps("leveldb 1.23")
add_deps("magic_enum 0.9.0")
add_deps("nlohmann_json 3.11.2")
add_deps("rapidjson 1.1.0")
on_load(function (package)
import("core.base.semver")

-- Dependencies from liteldev-repo.
add_deps("bdslibrary 1.20.50.03")
add_deps("ctre 3.8.1")
add_deps("pcg_cpp 1.0.0")
add_deps("pfr 2.1.1")
add_deps("preloader 1.3.0")
add_deps("symbolprovider 1.1.0")
local dependencies = {
["*"] = {
"ctre 3.8.1",
"entt 3.12.2",
"fmt 10.1.1",
"gsl 4.0.0",
"leveldb 1.23",
"magic_enum 0.9.0",
"nlohmann_json 3.11.2",
"rapidjson 1.1.0",
"pcg_cpp 1.0.0",
"pfr 2.1.1",
"preloader 1.4.0",
"symbolprovider 1.1.0"
},
["0.2.*"] = {
"bdslibrary 1.20.50.03"
}
}

for key, value in pairs(dependencies) do
if semver.satisfies(package:version_str(), key) then
for _, dependency in ipairs(value) do
package:add("deps", dependency)
end
end
end
end)

on_install(function (package)
import("package.tools.xmake").install(package)
os.cp("include", package:installdir())
os.cp("lib/*.lib", package:installdir("lib"))
end)

target("levilamina-plugin-template") -- Change this to your plugin name.
Expand All @@ -49,9 +66,6 @@ target("levilamina-plugin-template") -- Change this to your plugin name.
"-Wno-pragma-system-header-outside-header",
{tools = {"clang_cl"}}
)
add_undefines(
"_DEBUG"
)
add_defines(
"_AMD64_",
"_CRT_SECURE_NO_WARNINGS",
Expand Down Expand Up @@ -79,10 +93,12 @@ target("levilamina-plugin-template") -- Change this to your plugin name.
add_shflags(
"/DELAYLOAD:bedrock_server.dll"
)
add_undefines(
"_DEBUG"
)
set_exceptions("none")
set_kind("shared")
set_languages("c++20")
set_symbols("debug")
set_strip("all")

after_build(function (target)
Expand Down

0 comments on commit f62dc33

Please sign in to comment.