mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
A reasonable amount of the imhex framework now builds.
This commit is contained in:
@@ -1,53 +1,206 @@
|
||||
from build.c import cxxprogram, cxxlibrary
|
||||
from build.pkg import package
|
||||
from glob import glob
|
||||
from functools import reduce
|
||||
import operator
|
||||
from os.path import *
|
||||
|
||||
cflags = [
|
||||
'-DIMHEX_PROJECT_NAME=\\"fluxengine\\"',
|
||||
"-DOS_LINUX",
|
||||
"-DLIBROMFS_PROJECT_NAME=fluxengine",
|
||||
]
|
||||
|
||||
package(name="dbus_lib", package="dbus-1")
|
||||
package(name="freetype2_lib", package="freetype2")
|
||||
package(name="mbedcrypto_lib", package="mbedcrypto")
|
||||
package(name="libcurl_lib", package="libcurl")
|
||||
package(name="glfw3_lib", package="glfw3")
|
||||
|
||||
|
||||
def headers_from(path):
|
||||
hdrs = {k: f"{path}/{k}" for k in glob("**/*.h*", root_dir=path, recursive=True)}
|
||||
assert hdrs, f"path {path} contained no headers"
|
||||
return hdrs
|
||||
|
||||
|
||||
def sources_from(path):
|
||||
srcs = [join(path, f) for f in glob("**/*.c*", root_dir=path, recursive=True)]
|
||||
assert srcs, f"path {path} contained no sources"
|
||||
return srcs
|
||||
|
||||
|
||||
cxxlibrary(
|
||||
name="libnfd",
|
||||
srcs=[
|
||||
"dep/native-file-dialog/src/nfd_portal.cpp",
|
||||
],
|
||||
hdrs={
|
||||
"nfd.hpp": "dep/native-file-dialog/src/include/nfd.hpp",
|
||||
"nfd.h": "dep/native-file-dialog/src/include/nfd.h",
|
||||
},
|
||||
deps=[".+dbus_lib"],
|
||||
)
|
||||
|
||||
cxxlibrary(
|
||||
name="imgui",
|
||||
srcs=[],
|
||||
hdrs={
|
||||
k: f"dep/imgui/{k}"
|
||||
for k in glob("**/*.h", root_dir="dep/imgui", recursive=True)
|
||||
srcs=sources_from("dep/imhex/lib/third_party/imgui/backend/source")
|
||||
+ sources_from("dep/imhex/lib/third_party/imgui/imnodes/source")
|
||||
+ sources_from("dep/imhex/lib/third_party/imgui/implot/source")
|
||||
+ sources_from("dep/imhex/lib/third_party/imgui/implot3d/source")
|
||||
+ sources_from("dep/imhex/lib/third_party/imgui/imgui/source")
|
||||
+ sources_from("dep/imhex/lib/third_party/imgui/imgui_test_engine/source"),
|
||||
hdrs=reduce(
|
||||
operator.ior,
|
||||
[
|
||||
headers_from(f"dep/imhex/lib/third_party/imgui/{d}/include")
|
||||
for d in [
|
||||
"imgui",
|
||||
"backend",
|
||||
"implot",
|
||||
"implot3d",
|
||||
"imnodes",
|
||||
"imgui_test_engine",
|
||||
"cimgui",
|
||||
]
|
||||
],
|
||||
)
|
||||
| {
|
||||
"imgui_freetype.h": "dep/imhex/lib/third_party/imgui/imgui/include/misc/freetype/imgui_freetype.h",
|
||||
},
|
||||
deps=[".+freetype2_lib"],
|
||||
)
|
||||
|
||||
cxxlibrary(name="libxdgpp", srcs=[], hdrs={"xdg.hpp": "dep/xdgpp/xdg.hpp"})
|
||||
|
||||
cxxlibrary(
|
||||
name="libromfs",
|
||||
srcs=sources_from("dep/libromfs/lib/source"),
|
||||
hdrs={"romfs/romfs.hpp": "dep/libromfs/lib/include/romfs/romfs.hpp"},
|
||||
)
|
||||
|
||||
cxxprogram(
|
||||
name="mkromfs",
|
||||
srcs=sources_from("dep/libromfs/generator/source"),
|
||||
cflags=[
|
||||
'-DLIBROMFS_PROJECT_NAME=\\"fluxengine\\"',
|
||||
'-DRESOURCE_LOCATION=\\"rsrc\\"',
|
||||
],
|
||||
)
|
||||
|
||||
cxxlibrary(
|
||||
name="libwolv",
|
||||
srcs=[],
|
||||
srcs=[
|
||||
"dep/libwolv/libs/io/source/io/file.cpp",
|
||||
"dep/libwolv/libs/io/source/io/file_unix.cpp",
|
||||
"dep/libwolv/libs/io/source/io/fs.cpp",
|
||||
"dep/libwolv/libs/io/source/io/handle.cpp",
|
||||
"dep/libwolv/libs/utils/source/utils/string.cpp",
|
||||
],
|
||||
hdrs=reduce(
|
||||
operator.ior,
|
||||
[
|
||||
{
|
||||
k: f"dep/libwolv/libs/{d}/include/{k}"
|
||||
for k in glob(
|
||||
"**/*.hpp", root_dir=f"dep/libwolv/libs/{d}/include", recursive=True
|
||||
)
|
||||
}
|
||||
for d in ["types", "io", "utils"]
|
||||
headers_from(f"dep/libwolv/libs/{d}/include")
|
||||
for d in ["types", "io", "utils", "containers", "hash"]
|
||||
],
|
||||
)
|
||||
| {"types/uintwide_t.h": "dep/libwolv/libs/types/include/wolv/types/uintwide_t.h"},
|
||||
)
|
||||
|
||||
cxxlibrary(
|
||||
name="libthrowingptr", srcs=[], hdrs=headers_from("dep/throwing_ptr/include")
|
||||
)
|
||||
|
||||
cxxlibrary(
|
||||
name="libpl",
|
||||
srcs=sources_from("dep/pattern-language/lib/source"),
|
||||
hdrs=headers_from("dep/pattern-language/lib/include"),
|
||||
deps=[".+libthrowingptr", ".+libwolv"],
|
||||
)
|
||||
|
||||
cxxlibrary(name="hacks", srcs=[], hdrs={"jthread.hpp": "./jthread.hpp"})
|
||||
|
||||
cxxlibrary(
|
||||
name="libimhex",
|
||||
srcs=[],
|
||||
hdrs={
|
||||
k: f"dep/imhex/lib/libimhex/include/{k}"
|
||||
for k in glob(
|
||||
"**/*.h*", root_dir="dep/imhex/lib/libimhex/include", recursive=True
|
||||
)
|
||||
srcs=sources_from("dep/imhex/lib/libimhex/source/ui")
|
||||
+ sources_from("dep/imhex/lib/libimhex/source/api")
|
||||
+ [
|
||||
"dep/imhex/lib/libimhex/source/helpers/crypto.cpp",
|
||||
"dep/imhex/lib/libimhex/source/helpers/default_paths.cpp",
|
||||
"dep/imhex/lib/libimhex/source/helpers/fs.cpp",
|
||||
"dep/imhex/lib/libimhex/source/helpers/http_requests.cpp",
|
||||
"dep/imhex/lib/libimhex/source/helpers/http_requests_native.cpp",
|
||||
"dep/imhex/lib/libimhex/source/helpers/logger.cpp",
|
||||
"dep/imhex/lib/libimhex/source/helpers/opengl.cpp",
|
||||
"dep/imhex/lib/libimhex/source/helpers/scaling.cpp",
|
||||
"dep/imhex/lib/libimhex/source/helpers/semantic_version.cpp",
|
||||
"dep/imhex/lib/libimhex/source/helpers/utils.cpp",
|
||||
"dep/imhex/lib/libimhex/source/helpers/utils_linux.cpp",
|
||||
"dep/imhex/lib/libimhex/source/helpers/keys.cpp",
|
||||
],
|
||||
hdrs=headers_from("dep/imhex/lib/libimhex/include"),
|
||||
cflags=cflags + ["-I/usr/include/lunasvg"],
|
||||
caller_ldflags=["-llunasvg"],
|
||||
deps=[
|
||||
".+libwolv",
|
||||
".+imgui",
|
||||
".+libpl",
|
||||
".+libnfd",
|
||||
".+hacks",
|
||||
".+libxdgpp",
|
||||
".+mbedcrypto_lib",
|
||||
".+libcurl_lib",
|
||||
".+glfw3_lib",
|
||||
],
|
||||
)
|
||||
|
||||
cxxlibrary(
|
||||
name="libtrace",
|
||||
srcs=[
|
||||
"dep/imhex/lib/trace/source/stacktrace.cpp",
|
||||
"dep/imhex/lib/third_party/llvm-demangle/source/Demangle.cpp",
|
||||
"dep/imhex/lib/third_party/llvm-demangle/source/RustDemangle.cpp",
|
||||
"dep/imhex/lib/third_party/llvm-demangle/source/DLangDemangle.cpp",
|
||||
"dep/imhex/lib/third_party/llvm-demangle/source/ItaniumDemangle.cpp",
|
||||
"dep/imhex/lib/third_party/llvm-demangle/source/MicrosoftDemangle.cpp",
|
||||
"dep/imhex/lib/third_party/llvm-demangle/source/MicrosoftDemangleNodes.cpp",
|
||||
],
|
||||
hdrs=headers_from("dep/imhex/lib/trace/include")
|
||||
| headers_from("dep/imhex/lib/third_party/llvm-demangle/include")
|
||||
| {
|
||||
"ItaniumNodes.def": "dep/imhex/lib/third_party/llvm-demangle/include/llvm/Demangle/ItaniumNodes.def"
|
||||
},
|
||||
deps=[".+libwolv", ".+imgui"],
|
||||
)
|
||||
|
||||
cxxlibrary(
|
||||
name="init",
|
||||
srcs=[
|
||||
"dep/imhex/main/gui/source/init/run/common.cpp",
|
||||
"dep/imhex/main/gui/source/init/tasks.cpp",
|
||||
],
|
||||
hdrs=headers_from("dep/imhex/main/gui/include"),
|
||||
cflags=cflags,
|
||||
deps=[
|
||||
".+libimhex",
|
||||
".+imgui",
|
||||
".+libromfs",
|
||||
],
|
||||
)
|
||||
|
||||
cxxprogram(
|
||||
name="gui2",
|
||||
srcs=[
|
||||
"dep/imhex/main/gui/include/window.hpp",
|
||||
"dep/imhex/main/gui/include/messaging.hpp",
|
||||
"dep/imhex/main/gui/include/crash_handlers.hpp",
|
||||
"dep/imhex/main/gui/source/main.cpp",
|
||||
"dep/imhex/main/gui/source/messaging/common.cpp",
|
||||
"dep/imhex/main/gui/source/messaging/linux.cpp",
|
||||
"dep/imhex/main/gui/source/window/window.cpp",
|
||||
"dep/imhex/main/gui/source/window/platform/linux.cpp",
|
||||
"dep/imhex/main/gui/source/crash_handlers.cpp",
|
||||
],
|
||||
deps=[".+libimhex"],
|
||||
cflags=cflags,
|
||||
ldflags=["-ldl"],
|
||||
deps=[".+libimhex", ".+libpl", ".+init", ".+libtrace", "+fmt_lib", ".+hacks"],
|
||||
)
|
||||
|
||||
1
src/gui2/jthread.hpp
Normal file
1
src/gui2/jthread.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <thread>
|
||||
Reference in New Issue
Block a user