-
Notifications
You must be signed in to change notification settings - Fork 0
/
xmake.lua
38 lines (35 loc) · 1.97 KB
/
xmake.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
set_languages("cxx20")
set_arch("x64")
add_rules("mode.debug", "mode.release")
add_requires("spdlog 1.10.*", "nlohmann_json 3.11.*")
target("skip_main_menu")
set_kind("shared")
set_filename("cp_skip_main_menu.asi")
add_packages("spdlog", "nlohmann_json")
add_defines("UNICODE", "WIN32_LEAN_AND_MEAN")
set_pcxxheader("src/pch.h")
add_files("src/**.cpp")
add_links("User32")
add_headerfiles("src/**.h")
add_includedirs("src/")
on_install(function(target)
cprint("${green bright}Installing..")
local exe_path = path.join("$(installpath)", "bin", "x64", "Cyberpunk2077.exe")
assert(os.exists(exe_path), format("Can't find the game installation. Make sure the install path is set to game root directory.\n\tUse the follow command to set install path:\n\txmake f --installpath=%s", [["C:\Program Files (x86)\Steam\steamapps\common\Cyberpunk 2077"]]))
assert(os.exists(target:targetfile()), "target file doesn't exist, run xmake to build the target first.")
local output_dir = path.join("$(installpath)", "bin/x64/plugins")
os.cp(target:targetfile(), output_dir)
cprint("Installed at: ${underline}%s", output_dir)
end)
on_package(function (target)
os.rm("build/package/*")
os.mkdir("build/package/bin/x64/plugins/cyber_engine_tweaks/mods/cp_skip_main_menu/archive")
os.cp("scripts/*", "build/package/bin/x64/plugins/cyber_engine_tweaks/mods/cp_skip_main_menu")
os.cp("archive/*", "build/package/bin/x64/plugins/cyber_engine_tweaks/mods/cp_skip_main_menu/archive")
os.cp("LICENSE", "build/package/bin/x64/plugins/cyber_engine_tweaks/mods/cp_skip_main_menu")
os.cp(target:targetfile(), "build/package/bin/x64/plugins/")
end)
option("installpath")
set_default("installpath")
set_showmenu(true)
set_description("Set the path to the game root.", "e.g.", format("\t-xmake f --installpath=%s", [["C:\Program Files (x86)\Steam\steamapps\common\Cyberpunk 2077"]]))