1212 "-DIMHEX_STATIC_LINK_PLUGINS" ,
1313 '-DIMHEX_VERSION=\\ "0.0.0\\ "' ,
1414 "-DLUNASVG_BUILD_STATIC" ,
15+ "-DPLUTOVG_BUILD_STATIC" ,
16+ "-DUNICODE" ,
1517 # "-DDEBUG",
1618]
1719if config .osx :
2123else :
2224 cflags = cflags + ["-DOS_LINUX" ]
2325
24- r = simplerule (
25- name = "glfw-windows-fallback" ,
26- ins = [],
27- outs = [
28- "=glfw-3.4.bin.WIN32/include/GLFW/glfw3.h" ,
29- "=glfw-3.4.bin.WIN32/include/GLFW/glfw3native.h" ,
30- "=glfw-3.4.bin.WIN32/lib-mingw-w64/libglfw3.a" ,
31- ],
32- commands = [
33- "curl -Ls https://github.com/glfw/glfw/releases/download/3.4/glfw-3.4.bin.WIN32.zip -o $[dir]/glfw.zip" ,
34- "cd $[dir] && unzip -DD -o -q glfw.zip" ,
35- ],
36- label = "CURLLIBRARY" ,
37- traits = {"clibrary" , "cheaders" },
38- )
39- r .args ["caller_cflags" ] = [f"-I{ r .dir } /glfw-3.4.bin.WIN32/include" ]
40- r .args ["cheader_files" ] = [r ]
41- r .args ["cheader_deps" ] = [r ]
42-
4326
4427def headers_from (path ):
45- 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+ }
4631 assert hdrs , f"path { path } contained no headers"
4732 return hdrs
4833
4934
5035def sources_from (path , except_for = []):
51- 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+ ]
5239 srcs = [f for f in srcs if f not in except_for ]
5340 assert srcs , f"path { path } contained no sources"
5441 return srcs
5542
5643
5744package (name = "freetype2_lib" , package = "freetype2" )
5845package (name = "libcurl_lib" , package = "libcurl" )
59- package (name = "glfw3_lib" , package = "glfw3" , fallback = ".+glfw-windows-fallback" )
46+ package (name = "glfw3_lib" , package = "glfw3" )
47+ package (name = "magic_lib" , package = "libmagic" )
6048
6149cxxlibrary (
6250 name = "nlohmannjson_lib" ,
6351 srcs = [],
6452 hdrs = headers_from ("dep/nlohmann_json/single_include" ),
6553)
6654
67- clibrary (
68- name = "magic_lib" ,
69- srcs = sources_from (
70- "dep/file/src" , except_for = ["dep/file/src/file.c" , "dep/file/src/seccomp.c" ]
71- ),
72- hdrs = {"magic.h" : "dep/file/src/magic.h.in" },
73- )
74-
7555clibrary (
7656 name = "md4c_lib" ,
7757 srcs = sources_from ("dep/md4c/src" ),
@@ -114,13 +94,15 @@ def sources_from(path, except_for=[]):
11494 name = "plutovg" ,
11595 srcs = sources_from ("dep/lunasvg/plutovg/source" ),
11696 hdrs = headers_from ("dep/lunasvg/plutovg/include" ),
97+ cflags = cflags ,
11798)
11899
119100cxxlibrary (
120101 name = "lunasvg" ,
121102 srcs = sources_from ("dep/lunasvg/source" ),
122103 hdrs = headers_from ("dep/lunasvg/include" ),
123104 deps = [".+plutovg" , "+fmt_lib" ],
105+ cflags = cflags ,
124106)
125107
126108cxxlibrary (
@@ -189,7 +171,15 @@ def sources_from(path, except_for=[]):
189171 cflags = cflags ,
190172 )
191173
192- wolv_modules = ["types" , "io" , "utils" , "containers" , "hash" , "math_eval" , "net" ]
174+ wolv_modules = [
175+ "types" ,
176+ "io" ,
177+ "utils" ,
178+ "containers" ,
179+ "hash" ,
180+ "math_eval" ,
181+ "net" ,
182+ ]
193183cxxlibrary (
194184 name = "libwolv" ,
195185 srcs = (
@@ -211,13 +201,17 @@ def sources_from(path, except_for=[]):
211201 operator .ior ,
212202 [headers_from (f"dep/libwolv/libs/{ d } /include" ) for d in wolv_modules ],
213203 )
214- | {"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+ },
215207 deps = [".+libwolv-io-fs" ],
216208 cflags = cflags ,
217209)
218210
219211cxxlibrary (
220- name = "libthrowingptr" , srcs = [], hdrs = headers_from ("dep/throwing_ptr/include" )
212+ name = "libthrowingptr" ,
213+ srcs = [],
214+ hdrs = headers_from ("dep/throwing_ptr/include" ),
221215)
222216
223217cxxlibrary (
@@ -238,7 +232,9 @@ def sources_from(path, except_for=[]):
238232 ],
239233)
240234
241- 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+ )
242238
243239clibrary (
244240 name = "libmicrotar" ,
@@ -273,7 +269,9 @@ def sources_from(path, except_for=[]):
273269 sources_from ("dep/imhex/lib/libimhex/source/ui" )
274270 + sources_from (
275271 "dep/imhex/lib/libimhex/source/api" ,
276- 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+ ],
277275 )
278276 + sources_from ("dep/imhex/lib/libimhex/source/data_processor" )
279277 + sources_from ("dep/imhex/lib/libimhex/source/providers" )
@@ -426,7 +424,9 @@ def plugin(name, id, srcs, hdrs, romfsdir, deps):
426424 "dep/imhex/plugins/builtin/source/content/views/view_tutorials.cpp" ,
427425 "dep/imhex/plugins/builtin/source/content/data_processor_nodes.cpp" ,
428426 ]
429- + glob ("dep/imhex/plugins/builtin/source/content/data_processor_nodes/*" )
427+ + glob (
428+ "dep/imhex/plugins/builtin/source/content/data_processor_nodes/*"
429+ )
430430 + glob ("dep/imhex/plugins/builtin/source/content/tutorials/*" ),
431431 )
432432 + [
@@ -471,7 +471,10 @@ def plugin(name, id, srcs, hdrs, romfsdir, deps):
471471 ]
472472 if config .osx
473473 else (
474- ["dep/imhex/main/gui/source/window/platform/windows.cpp" ]
474+ [
475+ "dep/imhex/main/gui/source/window/platform/windows.cpp" ,
476+ "dep/imhex/main/gui/source/messaging/windows.cpp" ,
477+ ]
475478 if config .windows
476479 else [
477480 "dep/imhex/main/gui/source/window/platform/linux.cpp" ,
@@ -541,7 +544,9 @@ def plugin(name, id, srcs, hdrs, romfsdir, deps):
541544 "./main.cc" ,
542545 ],
543546 cflags = cflags ,
544- ldflags = ["-ldl" , "-lmbedcrypto" ],
547+ ldflags = ["-lmbedcrypto" ]
548+ + (["-ldl" ] if config .unix else [])
549+ + (["-ldwmapi" , "-lnetapi32" ] if config .windows else []),
545550 deps = [
546551 ".+libpl" ,
547552 "+fmt_lib" ,
0 commit comments