Skip to content

Commit 622bed8

Browse files
committed
build(xmake): get rid of complicated patternsleuth local vs package opt
1 parent e9b7da6 commit 622bed8

File tree

3 files changed

+12
-47
lines changed

3 files changed

+12
-47
lines changed

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ Currently supported options for these are:
103103
> [!TIP]
104104
> Configure the project using this command: `xmake f -m "<BuildMode>"`. `-m` is an alias for --**m**ode=\<BuildMode>.
105105
106-
#### Patternsleuth (Experimental)
107-
108-
By default, the patternsleuth tool installs itself as an xmake package. If you do not intend on modifying the patternsleuth source code, then you don't have to configure anything special. If you want to be able to modify the patternsleuth source code, you have to supply the `--patternsleuth=local` option to `xmake config` in order to recompile patternsleuth as part of the UE4SS build.
109-
110106
#### Proxy Path
111107

112108
By default, UE4SS generates a proxy based on `C:\Windows\System32\dwmapi.dll`. If you want to change this for any reason, you can supply the `--ue4ssProxyPath=<path proxy dll>` to the `xmake config` command..
Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,7 @@
1-
-- If patternsleuth is configured to install as a package.
2-
add_requires("cargo::patternsleuth_bind", { optional = not is_config("patternsleuth", "package"), debug = is_mode_debug(), configs = { cargo_toml = path.join(os.scriptdir(), "Cargo.toml") } })
3-
41
target("patternsleuth_bind")
52
set_kind("static")
6-
set_values("rust.cratetype", "staticlib")
73
add_files("src/lib.rs")
8-
-- Exposes the src/lib.rs files to the Visual Studio project filters.
9-
add_extrafiles("src/lib.rs")
10-
11-
-- If patternsleuth is configured to install as a package.
12-
if is_config("patternsleuth", "package") then
13-
add_packages("cargo::patternsleuth_bind")
14-
add_links("ws2_32", "advapi32", "userenv", "ntdll", "oleaut32", "bcrypt", "ole32", { public = true })
15-
end
16-
17-
-- If patternsleuth should be built as part of compilation.
18-
if is_config("patternsleuth", "local") then
19-
add_deps("patternsleuth")
20-
add_rules("rust.link")
21-
end
4+
add_deps("patternsleuth")
5+
set_values("rust.cratetype", "staticlib")
226

23-
-- We need to clean up the non-selected package/local version of patternsleuth when we reconfigure.
24-
-- This just deletes the .lib and keeps cargo deps on disk for faster recompilation.
25-
on_config(function(target)
26-
os.tryrm(target:targetfile())
27-
end)
7+
add_links("ws2_32", "advapi32", "userenv", "ntdll", "oleaut32", "bcrypt", "ole32", { public = true })

deps/first/xmake.lua

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ task("manuallyBuildLocalPatternsleuth")
2727
end)
2828

2929
if get_config("ue4ssCross") ~= "msvc-wine" then
30-
if is_config("patternsleuth", "local") then
31-
-- The patternsleuth target is managed by the cargo.build rule.
32-
target("patternsleuth")
33-
set_kind("static")
34-
add_rules("cargo.build", {project_name = "patternsleuth", is_debug = is_mode_debug(), features = { "process-internal", "image-pe" }})
35-
add_files("patternsleuth/Cargo.toml")
36-
-- Exposes the rust *.rs files to the Visual Studio project filters.
37-
add_extrafiles("patternsleuth/**.rs")
38-
end
30+
31+
-- The patternsleuth target is managed by the cargo.build rule.
32+
target("patternsleuth")
33+
set_kind("static")
34+
add_rules("cargo.build", {project_name = "patternsleuth", is_debug = is_mode_debug(), features = { "process-internal", "image-pe" }})
35+
add_files("patternsleuth/Cargo.toml")
36+
-- Exposes the rust *.rs files to the Visual Studio project filters.
37+
add_extrafiles("patternsleuth/**.rs")
38+
3939
else
4040
target("patternsleuth_bind")
4141
set_kind("static")
@@ -48,14 +48,3 @@ else
4848
task.run("manuallyBuildLocalPatternsleuth")
4949
end)
5050
end
51-
52-
-- This option allows users to choose if patternsleuth should be installed as a package
53-
-- or if patternsleuth should be built as a dependency by xmake. The `package` option
54-
-- should be used if you don't intend on ever modifying the patternsleuth source.
55-
-- The `local` option should be used if you want changes in the patternsleuth
56-
-- submodule to be included as part of the UE4SS build.
57-
option("patternsleuth")
58-
set_default("package")
59-
set_showmenu(true)
60-
set_values("package", "local")
61-
set_description("Install patternsleuth as a package or build it as a dependency.", "package", "local")

0 commit comments

Comments
 (0)