mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Get the executables building on WSL2 Fedora.
This commit is contained in:
41
Makefile
41
Makefile
@@ -1,9 +1,37 @@
|
|||||||
CC = gcc
|
export BUILDTYPE
|
||||||
CXX = g++ -std=c++17
|
BUILDTYPE ?= host
|
||||||
CFLAGS = -g -O3
|
|
||||||
LDFLAGS =
|
|
||||||
|
|
||||||
OBJ = .obj
|
ifeq ($(BUILDTYPE),windows)
|
||||||
|
MINGW = i686-w64-mingw32-
|
||||||
|
CC = $(MINGW)gcc
|
||||||
|
CXX = $(MINGW)g++ -std=c++17
|
||||||
|
CFLAGS += -g -O3
|
||||||
|
CXXFLAGS += \
|
||||||
|
-fext-numeric-literals \
|
||||||
|
-Wno-deprecated-enum-float-conversion \
|
||||||
|
-Wno-deprecated-enum-enum-conversion
|
||||||
|
LDFLAGS += -static
|
||||||
|
AR = $(MINGW)ar
|
||||||
|
PKG_CONFIG = $(MINGW)pkg-config -static
|
||||||
|
WINDRES = $(MINGW)windres
|
||||||
|
WX_CONFIG = /usr/i686-w64-mingw32/sys-root/mingw/bin/wx-config-3.0 --static=yes
|
||||||
|
EXT = .exe
|
||||||
|
else
|
||||||
|
CC = gcc
|
||||||
|
CXX = g++ -std=c++17
|
||||||
|
CFLAGS = -g -O3
|
||||||
|
LDFLAGS =
|
||||||
|
AR = ar
|
||||||
|
PKG_CONFIG = pkg-config
|
||||||
|
endif
|
||||||
|
|
||||||
|
HOSTCC = gcc
|
||||||
|
HOSTCXX = g++ -std=c++17
|
||||||
|
HOSTCFLAGS = -g -O3
|
||||||
|
HOSTLDFLAGS =
|
||||||
|
|
||||||
|
REALOBJ = .obj
|
||||||
|
OBJ = $(REALOBJ)/$(BUILDTYPE)
|
||||||
DESTDIR ?=
|
DESTDIR ?=
|
||||||
PREFIX ?= /usr/local
|
PREFIX ?= /usr/local
|
||||||
BINDIR ?= $(PREFIX)/bin
|
BINDIR ?= $(PREFIX)/bin
|
||||||
@@ -54,6 +82,9 @@ README.md: $(OBJ)/scripts/+mkdocindex/+mkdocindex$(EXT)
|
|||||||
.PHONY: install install-bin
|
.PHONY: install install-bin
|
||||||
install:: all install-bin
|
install:: all install-bin
|
||||||
|
|
||||||
|
clean::
|
||||||
|
$(hide) rm -rf $(REALOBJ)
|
||||||
|
|
||||||
install-bin:
|
install-bin:
|
||||||
@echo "INSTALL"
|
@echo "INSTALL"
|
||||||
$(hide) install -D -v "$(OBJ)/src+fluxengine/src+fluxengine" "$(DESTDIR)$(BINDIR)/fluxengine"
|
$(hide) install -D -v "$(OBJ)/src+fluxengine/src+fluxengine" "$(DESTDIR)$(BINDIR)/fluxengine"
|
||||||
|
|||||||
12
build.py
12
build.py
@@ -1,7 +1,7 @@
|
|||||||
from build.ab import export
|
from build.ab import export
|
||||||
from build.c import clibrary, cxxlibrary
|
from build.c import clibrary, cxxlibrary
|
||||||
from build.protobuf import proto, protocc
|
from build.protobuf import proto, protocc
|
||||||
from build.pkg import package
|
from build.pkg import package, hostpackage
|
||||||
from build.utils import test
|
from build.utils import test
|
||||||
from glob import glob
|
from glob import glob
|
||||||
import config
|
import config
|
||||||
@@ -9,9 +9,14 @@ import re
|
|||||||
|
|
||||||
package(name="protobuf_lib", package="protobuf")
|
package(name="protobuf_lib", package="protobuf")
|
||||||
package(name="z_lib", package="zlib")
|
package(name="z_lib", package="zlib")
|
||||||
package(name="fmt_lib", package="fmt")
|
package(name="fmt_lib", package="fmt", fallback="dep/fmt")
|
||||||
package(name="sqlite3_lib", package="sqlite3")
|
package(name="sqlite3_lib", package="sqlite3")
|
||||||
|
|
||||||
|
hostpackage(name="protobuf_host_lib", package="protobuf")
|
||||||
|
hostpackage(name="z_host_lib", package="zlib")
|
||||||
|
hostpackage(name="fmt_host_lib", package="fmt")
|
||||||
|
hostpackage(name="sqlite3_host_lib", package="sqlite3")
|
||||||
|
|
||||||
clibrary(name="protocol", hdrs={"protocol.h": "./protocol.h"})
|
clibrary(name="protocol", hdrs={"protocol.h": "./protocol.h"})
|
||||||
|
|
||||||
proto(name="fl2_proto", srcs=["lib/fl2.proto"])
|
proto(name="fl2_proto", srcs=["lib/fl2.proto"])
|
||||||
@@ -211,14 +216,15 @@ cxxlibrary(
|
|||||||
},
|
},
|
||||||
deps=[
|
deps=[
|
||||||
"+fl2_proto_lib",
|
"+fl2_proto_lib",
|
||||||
|
"+fmt_lib",
|
||||||
"+protocol",
|
"+protocol",
|
||||||
"lib+config_proto_lib",
|
|
||||||
"dep/adflib",
|
"dep/adflib",
|
||||||
"dep/agg",
|
"dep/agg",
|
||||||
"dep/fatfs",
|
"dep/fatfs",
|
||||||
"dep/hfsutils",
|
"dep/hfsutils",
|
||||||
"dep/libusbp",
|
"dep/libusbp",
|
||||||
"dep/stb",
|
"dep/stb",
|
||||||
|
"lib+config_proto_lib",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ update-ab:
|
|||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean::
|
clean::
|
||||||
@echo CLEAN
|
@echo CLEAN
|
||||||
$(hide) rm -rf $(OBJ) bin
|
$(hide) rm -rf $(OBJ)
|
||||||
|
|
||||||
export PYTHONHASHSEED = 1
|
export PYTHONHASHSEED = 1
|
||||||
build-files = $(shell find . -name 'build.py') $(wildcard build/*.py) $(wildcard config.py)
|
build-files = $(shell find . -name 'build.py') $(wildcard build/*.py) $(wildcard config.py)
|
||||||
|
|||||||
@@ -401,6 +401,7 @@ def emitter_endrule(rule, outs):
|
|||||||
emit("\t$(hide) touch", rule.sentinel)
|
emit("\t$(hide) touch", rule.sentinel)
|
||||||
|
|
||||||
for f in filenamesof(outs):
|
for f in filenamesof(outs):
|
||||||
|
emit(".SECONDARY:", f)
|
||||||
emit(f, ":", rule.sentinel, ";")
|
emit(f, ":", rule.sentinel, ";")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
91
build/c.py
91
build/c.py
@@ -18,6 +18,26 @@ from os.path import *
|
|||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
|
|
||||||
|
|
||||||
|
class Toolchain:
|
||||||
|
label = ""
|
||||||
|
cfile = ["$(CC) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"]
|
||||||
|
cxxfile = ["$(CXX) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"]
|
||||||
|
clibrary = ["$(AR) cqs {outs[0]} {ins}"]
|
||||||
|
cxxlibrary = ["$(AR) cqs {outs[0]} {ins}"]
|
||||||
|
cprogram = ["$(CC) -o {outs[0]} {ins} {ldflags} $(LDFLAGS)"]
|
||||||
|
cxxprogram = ["$(CXX) -o {outs[0]} {ins} {ldflags} $(LDFLAGS)"]
|
||||||
|
|
||||||
|
|
||||||
|
class HostToolchain:
|
||||||
|
label = "HOST "
|
||||||
|
cfile = ["$(HOSTCC) -c -o {outs[0]} {ins[0]} $(HOSTCFLAGS) {cflags}"]
|
||||||
|
cxxfile = ["$(HOSTCXX) -c -o {outs[0]} {ins[0]} $(HOSTCFLAGS) {cflags}"]
|
||||||
|
clibrary = ["$(HOSTAR) cqs {outs[0]} {ins}"]
|
||||||
|
cxxlibrary = ["$(HOSTAR) cqs {outs[0]} {ins}"]
|
||||||
|
cprogram = ["$(HOSTCC) -o {outs[0]} {ins} {ldflags} $(HOSTLDFLAGS)"]
|
||||||
|
cxxprogram = ["$(HOSTCXX) -o {outs[0]} {ins} {ldflags} $(HOSTLDFLAGS)"]
|
||||||
|
|
||||||
|
|
||||||
def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, cflags):
|
def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, cflags):
|
||||||
outleaf = stripext(basename(filenameof(srcs[0]))) + suffix
|
outleaf = stripext(basename(filenameof(srcs[0]))) + suffix
|
||||||
|
|
||||||
@@ -40,9 +60,14 @@ def cfile(
|
|||||||
deps: Targets = None,
|
deps: Targets = None,
|
||||||
cflags: List = [],
|
cflags: List = [],
|
||||||
suffix=".o",
|
suffix=".o",
|
||||||
commands=["$(CC) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"],
|
toolchain=Toolchain,
|
||||||
label="CC",
|
commands=None,
|
||||||
|
label=None,
|
||||||
):
|
):
|
||||||
|
if not label:
|
||||||
|
label = toolchain.label + "CC"
|
||||||
|
if not commands:
|
||||||
|
commands = toolchain.cfile
|
||||||
cfileimpl(self, name, srcs, deps, suffix, commands, label, "cfile", cflags)
|
cfileimpl(self, name, srcs, deps, suffix, commands, label, "cfile", cflags)
|
||||||
|
|
||||||
|
|
||||||
@@ -54,15 +79,20 @@ def cxxfile(
|
|||||||
deps: Targets = None,
|
deps: Targets = None,
|
||||||
cflags: List = [],
|
cflags: List = [],
|
||||||
suffix=".o",
|
suffix=".o",
|
||||||
commands=["$(CXX) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"],
|
toolchain=Toolchain,
|
||||||
label="CXX",
|
commands=None,
|
||||||
|
label=None,
|
||||||
):
|
):
|
||||||
|
if not label:
|
||||||
|
label = toolchain.label + "CC"
|
||||||
|
if not commands:
|
||||||
|
commands = toolchain.cfile
|
||||||
cfileimpl(
|
cfileimpl(
|
||||||
self, name, srcs, deps, suffix, commands, label, "cxxfile", cflags
|
self, name, srcs, deps, suffix, commands, label, "cxxfile", cflags
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def findsources(name, srcs, deps, cflags, filerule):
|
def findsources(name, srcs, deps, cflags, toolchain, filerule):
|
||||||
objs = []
|
objs = []
|
||||||
for s in flatten(srcs):
|
for s in flatten(srcs):
|
||||||
objs += [
|
objs += [
|
||||||
@@ -71,6 +101,7 @@ def findsources(name, srcs, deps, cflags, filerule):
|
|||||||
srcs=[f],
|
srcs=[f],
|
||||||
deps=deps,
|
deps=deps,
|
||||||
cflags=cflags,
|
cflags=cflags,
|
||||||
|
toolchain=toolchain,
|
||||||
)
|
)
|
||||||
for f in filenamesof(s)
|
for f in filenamesof(s)
|
||||||
if f.endswith(".c")
|
if f.endswith(".c")
|
||||||
@@ -131,6 +162,7 @@ def libraryimpl(
|
|||||||
caller_ldflags,
|
caller_ldflags,
|
||||||
cflags,
|
cflags,
|
||||||
ldflags,
|
ldflags,
|
||||||
|
toolchain,
|
||||||
commands,
|
commands,
|
||||||
label,
|
label,
|
||||||
kind,
|
kind,
|
||||||
@@ -159,6 +191,7 @@ def libraryimpl(
|
|||||||
srcs,
|
srcs,
|
||||||
targetswithtraitsof(deps, "cheaders"),
|
targetswithtraitsof(deps, "cheaders"),
|
||||||
cflags + bubbledattrsof(deps, "caller_cflags"),
|
cflags + bubbledattrsof(deps, "caller_cflags"),
|
||||||
|
toolchain,
|
||||||
kind,
|
kind,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -188,10 +221,15 @@ def clibrary(
|
|||||||
caller_ldflags: List = [],
|
caller_ldflags: List = [],
|
||||||
cflags: List = [],
|
cflags: List = [],
|
||||||
ldflags: List = [],
|
ldflags: List = [],
|
||||||
commands=["$(AR) cqs {outs[0]} {ins}"],
|
toolchain=Toolchain,
|
||||||
label="LIB",
|
commands=None,
|
||||||
|
label=None,
|
||||||
cfilerule=cfile,
|
cfilerule=cfile,
|
||||||
):
|
):
|
||||||
|
if not label:
|
||||||
|
label = toolchain.label + "LIB"
|
||||||
|
if not commands:
|
||||||
|
commands = toolchain.clibrary
|
||||||
libraryimpl(
|
libraryimpl(
|
||||||
self,
|
self,
|
||||||
name,
|
name,
|
||||||
@@ -202,6 +240,7 @@ def clibrary(
|
|||||||
caller_ldflags,
|
caller_ldflags,
|
||||||
cflags,
|
cflags,
|
||||||
ldflags,
|
ldflags,
|
||||||
|
toolchain,
|
||||||
commands,
|
commands,
|
||||||
label,
|
label,
|
||||||
cfilerule,
|
cfilerule,
|
||||||
@@ -219,9 +258,14 @@ def cxxlibrary(
|
|||||||
caller_ldflags: List = [],
|
caller_ldflags: List = [],
|
||||||
cflags: List = [],
|
cflags: List = [],
|
||||||
ldflags: List = [],
|
ldflags: List = [],
|
||||||
commands=["$(AR) cqs {outs[0]} {ins}"],
|
toolchain=Toolchain,
|
||||||
label="LIB",
|
commands=None,
|
||||||
|
label=None,
|
||||||
):
|
):
|
||||||
|
if not label:
|
||||||
|
label = toolchain.label + "LIB"
|
||||||
|
if not commands:
|
||||||
|
commands = toolchain.clibrary
|
||||||
libraryimpl(
|
libraryimpl(
|
||||||
self,
|
self,
|
||||||
name,
|
name,
|
||||||
@@ -232,6 +276,7 @@ def cxxlibrary(
|
|||||||
caller_ldflags,
|
caller_ldflags,
|
||||||
cflags,
|
cflags,
|
||||||
ldflags,
|
ldflags,
|
||||||
|
toolchain,
|
||||||
commands,
|
commands,
|
||||||
label,
|
label,
|
||||||
cxxfile,
|
cxxfile,
|
||||||
@@ -239,19 +284,29 @@ def cxxlibrary(
|
|||||||
|
|
||||||
|
|
||||||
def programimpl(
|
def programimpl(
|
||||||
self, name, srcs, deps, cflags, ldflags, commands, label, filerule, kind
|
self,
|
||||||
|
name,
|
||||||
|
srcs,
|
||||||
|
deps,
|
||||||
|
cflags,
|
||||||
|
ldflags,
|
||||||
|
toolchain,
|
||||||
|
commands,
|
||||||
|
label,
|
||||||
|
filerule,
|
||||||
|
kind,
|
||||||
):
|
):
|
||||||
ars = filenamesmatchingof(deps, "*.a")
|
ars = filenamesmatchingof(deps, "*.a")
|
||||||
deps = deps + filenamesmatchingof(srcs, "*.h")
|
deps = deps + filenamesmatchingof(srcs, "*.h")
|
||||||
ldflags = ldflags + bubbledattrsof(deps, "caller_ldflags")
|
ldflags = ldflags + bubbledattrsof(deps, "caller_ldflags")
|
||||||
|
|
||||||
cfiles = findsources(name, srcs, deps, cflags, filerule)
|
cfiles = findsources(name, srcs, deps, cflags, toolchain, filerule)
|
||||||
normalrule(
|
normalrule(
|
||||||
replaces=self,
|
replaces=self,
|
||||||
ins=cfiles + ars + ars,
|
ins=cfiles + ars + ars,
|
||||||
outs=[basename(name) + "$(EXT)"],
|
outs=[basename(name) + "$(EXT)"],
|
||||||
deps=deps,
|
deps=deps,
|
||||||
label=label,
|
label=toolchain.label + label,
|
||||||
commands=commands,
|
commands=commands,
|
||||||
ldflags=ldflags,
|
ldflags=ldflags,
|
||||||
)
|
)
|
||||||
@@ -265,11 +320,14 @@ def cprogram(
|
|||||||
deps: Targets = None,
|
deps: Targets = None,
|
||||||
cflags: List = [],
|
cflags: List = [],
|
||||||
ldflags: List = [],
|
ldflags: List = [],
|
||||||
commands=["$(CC) -o {outs[0]} {ins} {ldflags} $(LDFLAGS)"],
|
toolchain=Toolchain,
|
||||||
|
commands=None,
|
||||||
label="CLINK",
|
label="CLINK",
|
||||||
cfilerule=cfile,
|
cfilerule=cfile,
|
||||||
cfilekind="cprogram",
|
cfilekind="cprogram",
|
||||||
):
|
):
|
||||||
|
if not commands:
|
||||||
|
commands = toolchain.cprogram
|
||||||
programimpl(
|
programimpl(
|
||||||
self,
|
self,
|
||||||
name,
|
name,
|
||||||
@@ -277,6 +335,7 @@ def cprogram(
|
|||||||
deps,
|
deps,
|
||||||
cflags,
|
cflags,
|
||||||
ldflags,
|
ldflags,
|
||||||
|
toolchain,
|
||||||
commands,
|
commands,
|
||||||
label,
|
label,
|
||||||
cfilerule,
|
cfilerule,
|
||||||
@@ -292,9 +351,12 @@ def cxxprogram(
|
|||||||
deps: Targets = None,
|
deps: Targets = None,
|
||||||
cflags: List = [],
|
cflags: List = [],
|
||||||
ldflags: List = [],
|
ldflags: List = [],
|
||||||
commands=["$(CXX) -o {outs[0]} {ins} {ldflags} $(LDFLAGS)"],
|
toolchain=Toolchain,
|
||||||
|
commands=None,
|
||||||
label="CXXLINK",
|
label="CXXLINK",
|
||||||
):
|
):
|
||||||
|
if not commands:
|
||||||
|
commands = toolchain.cxxprogram
|
||||||
programimpl(
|
programimpl(
|
||||||
self,
|
self,
|
||||||
name,
|
name,
|
||||||
@@ -302,6 +364,7 @@ def cxxprogram(
|
|||||||
deps,
|
deps,
|
||||||
cflags,
|
cflags,
|
||||||
ldflags,
|
ldflags,
|
||||||
|
toolchain,
|
||||||
commands,
|
commands,
|
||||||
label,
|
label,
|
||||||
cxxfile,
|
cxxfile,
|
||||||
|
|||||||
44
build/pkg.py
44
build/pkg.py
@@ -1,4 +1,4 @@
|
|||||||
from build.ab import Rule, emit, Target, bubbledattrsof
|
from build.ab import Rule, emit, Target, bubbledattrsof, filenamesof
|
||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
@@ -7,12 +7,18 @@ emit(
|
|||||||
"""
|
"""
|
||||||
PKG_CONFIG ?= pkg-config
|
PKG_CONFIG ?= pkg-config
|
||||||
PACKAGES := $(shell $(PKG_CONFIG) --list-all | cut -d' ' -f1 | sort)
|
PACKAGES := $(shell $(PKG_CONFIG) --list-all | cut -d' ' -f1 | sort)
|
||||||
|
|
||||||
|
HOST_PKG_CONFIG ?= pkg-config
|
||||||
|
HOST_PACKAGES := $(shell $(HOST_PKG_CONFIG) --list-all | cut -d' ' -f1 | sort)
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
def package(self, name, package=None, fallback: Target = None):
|
def package(self, name, package=None, fallback: Target = None):
|
||||||
|
self.ins = []
|
||||||
|
self.outs = []
|
||||||
|
|
||||||
emit("ifeq ($(filter %s, $(PACKAGES)),)" % package)
|
emit("ifeq ($(filter %s, $(PACKAGES)),)" % package)
|
||||||
if fallback:
|
if fallback:
|
||||||
emit(
|
emit(
|
||||||
@@ -23,7 +29,7 @@ def package(self, name, package=None, fallback: Target = None):
|
|||||||
f"PACKAGE_LDFLAGS_{package} := ",
|
f"PACKAGE_LDFLAGS_{package} := ",
|
||||||
bubbledattrsof(fallback, "caller_ldflags"),
|
bubbledattrsof(fallback, "caller_ldflags"),
|
||||||
)
|
)
|
||||||
emit(f"PACKAGE_DEP_{package} := ", fallback.name)
|
self.outs = filenamesof(fallback)
|
||||||
else:
|
else:
|
||||||
emit(f"$(error Required package '{package}' not installed.)")
|
emit(f"$(error Required package '{package}' not installed.)")
|
||||||
emit("else")
|
emit("else")
|
||||||
@@ -33,11 +39,41 @@ def package(self, name, package=None, fallback: Target = None):
|
|||||||
emit(
|
emit(
|
||||||
f"PACKAGE_LDFLAGS_{package} := $(shell $(PKG_CONFIG) --libs {package})"
|
f"PACKAGE_LDFLAGS_{package} := $(shell $(PKG_CONFIG) --libs {package})"
|
||||||
)
|
)
|
||||||
emit(f"PACKAGE_DEP_{package} := ")
|
|
||||||
emit("endif")
|
emit("endif")
|
||||||
|
|
||||||
self.attr.caller_cflags = [f"$(PACKAGE_CFLAGS_{package})"]
|
self.attr.caller_cflags = [f"$(PACKAGE_CFLAGS_{package})"]
|
||||||
self.attr.caller_ldflags = [f"$(PACKAGE_LDFLAGS_{package})"]
|
self.attr.caller_ldflags = [f"$(PACKAGE_LDFLAGS_{package})"]
|
||||||
|
self.traits.add("clibrary")
|
||||||
|
self.traits.add("cheaders")
|
||||||
|
|
||||||
|
|
||||||
|
@Rule
|
||||||
|
def hostpackage(self, name, package=None, fallback: Target = None):
|
||||||
|
emit("ifeq ($(filter %s, $(HOST_PACKAGES)),)" % package)
|
||||||
|
if fallback:
|
||||||
|
emit(
|
||||||
|
f"HOST_PACKAGE_CFLAGS_{package} :=",
|
||||||
|
bubbledattrsof(fallback, "caller_cflags"),
|
||||||
|
)
|
||||||
|
emit(
|
||||||
|
f"HOST_PACKAGE_LDFLAGS_{package} := ",
|
||||||
|
bubbledattrsof(fallback, "caller_ldflags"),
|
||||||
|
)
|
||||||
|
emit(f"HOST_PACKAGE_DEP_{package} := ", fallback.name)
|
||||||
|
else:
|
||||||
|
emit(f"$(error Required host package '{package}' not installed.)")
|
||||||
|
emit("else")
|
||||||
|
emit(
|
||||||
|
f"HOST_PACKAGE_CFLAGS_{package} := $(shell $(HOST_PKG_CONFIG) --cflags {package})"
|
||||||
|
)
|
||||||
|
emit(
|
||||||
|
f"HOST_PACKAGE_LDFLAGS_{package} := $(shell $(HOST_PKG_CONFIG) --libs {package})"
|
||||||
|
)
|
||||||
|
emit(f"HOST_PACKAGE_DEP_{package} := ")
|
||||||
|
emit("endif")
|
||||||
|
|
||||||
|
self.attr.caller_cflags = [f"$(HOST_PACKAGE_CFLAGS_{package})"]
|
||||||
|
self.attr.caller_ldflags = [f"$(HOST_PACKAGE_LDFLAGS_{package})"]
|
||||||
|
|
||||||
self.ins = []
|
self.ins = []
|
||||||
self.outs = [f"$(PACKAGE_DEP_{package})"]
|
self.outs = [f"$(HOST_PACKAGE_DEP_{package})"]
|
||||||
|
|||||||
12
config.py
12
config.py
@@ -1,5 +1,11 @@
|
|||||||
import platform
|
import platform
|
||||||
|
import os
|
||||||
|
|
||||||
windows = platform.system() == "Windows"
|
if os.getenv("BUILDTYPE") == "windows":
|
||||||
osx = platform.system() == "Darwin"
|
windows = True
|
||||||
unix = not windows
|
osx = False
|
||||||
|
unix = False
|
||||||
|
else:
|
||||||
|
windows = False
|
||||||
|
osx = platform.system() == "Darwin"
|
||||||
|
unix = True
|
||||||
|
|||||||
17
dep/fmt/build.py
Normal file
17
dep/fmt/build.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
from build.c import cxxlibrary, HostToolchain
|
||||||
|
|
||||||
|
cxxlibrary(
|
||||||
|
name="fmt",
|
||||||
|
srcs=[
|
||||||
|
"./src/format.cc",
|
||||||
|
"./src/os.cc",
|
||||||
|
],
|
||||||
|
cflags=["-Idep/fmt/include"],
|
||||||
|
hdrs={
|
||||||
|
"fmt/args.h": "./include/fmt/args.h",
|
||||||
|
"fmt/chrono.h": "./include/fmt/chrono.h",
|
||||||
|
"fmt/core.h": "./include/fmt/core.h",
|
||||||
|
"fmt/format.h": "./include/fmt/format.h",
|
||||||
|
"fmt/ostream.h": "./include/fmt/ostream.h",
|
||||||
|
"fmt/ranges.h": "./include/fmt/ranges.h",
|
||||||
|
})
|
||||||
@@ -61,7 +61,7 @@ clibrary(
|
|||||||
name="libusbp",
|
name="libusbp",
|
||||||
srcs=srcs,
|
srcs=srcs,
|
||||||
cflags=["-Idep/libusbp/include", "-Idep/libusbp/src"],
|
cflags=["-Idep/libusbp/include", "-Idep/libusbp/src"],
|
||||||
ldflags=ldflags,
|
caller_ldflags=ldflags,
|
||||||
deps=deps,
|
deps=deps,
|
||||||
hdrs={
|
hdrs={
|
||||||
"libusbp_internal.h": "./src/libusbp_internal.h",
|
"libusbp_internal.h": "./src/libusbp_internal.h",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from build.ab import Rule, normalrule, Targets
|
from build.ab import Rule, normalrule, Targets
|
||||||
from build.c import cxxprogram
|
from build.c import cxxprogram, HostToolchain
|
||||||
|
|
||||||
encoders = {}
|
encoders = {}
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,4 @@
|
|||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
|
|
||||||
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "src/gui/manifest.xml"
|
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "src/gui/manifest.xml"
|
||||||
101 ICON DISCARDABLE ".obj/extras+fluxengine_ico/fluxengine.ico"
|
101 ICON DISCARDABLE ".obj/windows/extras/+fluxengine_ico/fluxengine.ico"
|
||||||
|
|||||||
Reference in New Issue
Block a user