Skip to content

Commit 0ba4b82

Browse files
committed
Only require libtre on Windows.
1 parent ffd9e28 commit 0ba4b82

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

src/gui2/build.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,17 @@
2525

2626

2727
def headers_from(path):
28-
hdrs = {k: f"{path}/{k}" for k in glob("**/*.h*", root_dir=path, recursive=True)}
28+
hdrs = {
29+
k: f"{path}/{k}" for k in glob("**/*.h*", root_dir=path, recursive=True)
30+
}
2931
assert hdrs, f"path {path} contained no headers"
3032
return hdrs
3133

3234

3335
def sources_from(path, except_for=[]):
34-
srcs = [join(path, f) for f in glob("**/*.[ch]*", root_dir=path, recursive=True)]
36+
srcs = [
37+
join(path, f) for f in glob("**/*.[ch]*", root_dir=path, recursive=True)
38+
]
3539
srcs = [f for f in srcs if f not in except_for]
3640
assert srcs, f"path {path} contained no sources"
3741
return srcs
@@ -41,7 +45,6 @@ def sources_from(path, except_for=[]):
4145
package(name="libcurl_lib", package="libcurl")
4246
package(name="glfw3_lib", package="glfw3")
4347
package(name="magic_lib", package="libmagic")
44-
package(name="tre_lib", package="tre")
4548

4649
cxxlibrary(
4750
name="nlohmannjson_lib",
@@ -198,7 +201,9 @@ def sources_from(path, except_for=[]):
198201
operator.ior,
199202
[headers_from(f"dep/libwolv/libs/{d}/include") for d in wolv_modules],
200203
)
201-
| {"types/uintwide_t.h": "dep/libwolv/libs/types/include/wolv/types/uintwide_t.h"},
204+
| {
205+
"types/uintwide_t.h": "dep/libwolv/libs/types/include/wolv/types/uintwide_t.h"
206+
},
202207
deps=[".+libwolv-io-fs"],
203208
cflags=cflags,
204209
)
@@ -227,7 +232,9 @@ def sources_from(path, except_for=[]):
227232
],
228233
)
229234

230-
cxxlibrary(name="hacks", srcs=[], hdrs={"jthread.hpp": "./imhex_overrides/jthread.hpp"})
235+
cxxlibrary(
236+
name="hacks", srcs=[], hdrs={"jthread.hpp": "./imhex_overrides/jthread.hpp"}
237+
)
231238

232239
clibrary(
233240
name="libmicrotar",
@@ -262,7 +269,9 @@ def sources_from(path, except_for=[]):
262269
sources_from("dep/imhex/lib/libimhex/source/ui")
263270
+ sources_from(
264271
"dep/imhex/lib/libimhex/source/api",
265-
except_for=["dep/imhex/lib/libimhex/source/api/achievement_manager.cpp"],
272+
except_for=[
273+
"dep/imhex/lib/libimhex/source/api/achievement_manager.cpp"
274+
],
266275
)
267276
+ sources_from("dep/imhex/lib/libimhex/source/data_processor")
268277
+ sources_from("dep/imhex/lib/libimhex/source/providers")
@@ -415,7 +424,9 @@ def plugin(name, id, srcs, hdrs, romfsdir, deps):
415424
"dep/imhex/plugins/builtin/source/content/views/view_tutorials.cpp",
416425
"dep/imhex/plugins/builtin/source/content/data_processor_nodes.cpp",
417426
]
418-
+ glob("dep/imhex/plugins/builtin/source/content/data_processor_nodes/*")
427+
+ glob(
428+
"dep/imhex/plugins/builtin/source/content/data_processor_nodes/*"
429+
)
419430
+ glob("dep/imhex/plugins/builtin/source/content/tutorials/*"),
420431
)
421432
+ [
@@ -544,6 +555,7 @@ def plugin(name, id, srcs, hdrs, romfsdir, deps):
544555
".+ui-plugin",
545556
".+gui-plugin",
546557
".+fluxengine-plugin",
547-
".+tre_lib",
548-
],
558+
]
559+
# Windows needs this, for some reason.
560+
+ (config.windows and [package(name="tre_lib", package="tre")] or []),
549561
)

0 commit comments

Comments
 (0)