mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Make the Windows binaries build.
This commit is contained in:
20
Makefile
20
Makefile
@@ -5,6 +5,26 @@ LDFLAGS =
|
||||
|
||||
OBJ = .obj
|
||||
|
||||
# Special Windows settings.
|
||||
|
||||
ifeq ($(OS), Windows_NT)
|
||||
MINGWBIN = /mingw32/bin
|
||||
CCPREFIX = $(MINGWBIN)/
|
||||
PKG_CONFIG = $(MINGWBIN)/pkg-config
|
||||
WX_CONFIG = /usr/bin/sh $(MINGWBIN)/wx-config --static=yes
|
||||
PROTOC = $(MINGWBIN)/protoc
|
||||
LDFLAGS += \
|
||||
-static
|
||||
CXXFLAGS += \
|
||||
-fext-numeric-literals \
|
||||
-Wno-deprecated-enum-float-conversion \
|
||||
-Wno-deprecated-enum-enum-conversion
|
||||
|
||||
# Required to get the gcc run - time libraries on the path.
|
||||
export PATH := $(PATH):$(MINGWBIN)
|
||||
EXT ?= .exe
|
||||
endif
|
||||
|
||||
# Special OSX settings.
|
||||
|
||||
ifeq ($(shell uname),Darwin)
|
||||
|
||||
@@ -13,6 +13,11 @@ hide = @
|
||||
PKG_CONFIG ?= pkg-config
|
||||
ECHO ?= echo
|
||||
|
||||
ifeq ($(OS), Windows_NT)
|
||||
EXT ?= .exe
|
||||
endif
|
||||
EXT ?=
|
||||
|
||||
include $(OBJ)/build.mk
|
||||
|
||||
.PHONY: update-ab
|
||||
|
||||
11
build/c.py
11
build/c.py
@@ -75,13 +75,12 @@ def findsources(name, srcs, deps, cflags, filerule):
|
||||
return objs
|
||||
|
||||
|
||||
def libraryimpl(self, name, srcs, deps, hdrs, cflags, commands, label, kind):
|
||||
def libraryimpl(self, name, srcs, deps, hdrs, cflags, ldflags, commands, label, kind):
|
||||
if not srcs and not hdrs:
|
||||
raise ABException(
|
||||
"clibrary contains no sources and no exported headers"
|
||||
)
|
||||
|
||||
ldflags = []
|
||||
libraries = [d for d in deps if hasattr(d, "clibrary")]
|
||||
for library in libraries:
|
||||
if library.clibrary.cflags:
|
||||
@@ -162,11 +161,12 @@ def clibrary(
|
||||
deps: Targets = [],
|
||||
hdrs: TargetsMap = {},
|
||||
cflags=[],
|
||||
ldflags=[],
|
||||
commands=["$(AR) cqs {outs[0]} {ins}"],
|
||||
label="LIB",
|
||||
):
|
||||
return libraryimpl(
|
||||
self, name, srcs, deps, hdrs, cflags, commands, label, cfile
|
||||
self, name, srcs, deps, hdrs, cflags, ldflags, commands, label, cfile
|
||||
)
|
||||
|
||||
|
||||
@@ -178,11 +178,12 @@ def cxxlibrary(
|
||||
deps: Targets = [],
|
||||
hdrs: TargetsMap = {},
|
||||
cflags=[],
|
||||
ldflags=[],
|
||||
commands=["$(AR) cqs {outs[0]} {ins}"],
|
||||
label="LIB",
|
||||
):
|
||||
return libraryimpl(
|
||||
self, name, srcs, deps, hdrs, cflags, commands, label, cxxfile
|
||||
self, name, srcs, deps, hdrs, cflags, ldflags, commands, label, cxxfile
|
||||
)
|
||||
|
||||
|
||||
@@ -202,7 +203,7 @@ def programimpl(
|
||||
normalrule(
|
||||
replaces=self,
|
||||
ins=(findsources(name, srcs, deps, cflags, filerule) + ars + ars),
|
||||
outs=[basename(name)],
|
||||
outs=[basename(name)+"$(EXT)"],
|
||||
deps=deps,
|
||||
label=label,
|
||||
commands=commands,
|
||||
|
||||
9
dep/emu/build.py
Normal file
9
dep/emu/build.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from build.c import clibrary
|
||||
|
||||
clibrary(
|
||||
name="emu",
|
||||
srcs=["./fnmatch.c"],
|
||||
hdrs={
|
||||
"fnmatch.h": "./fnmatch.h"
|
||||
}
|
||||
)
|
||||
@@ -1,3 +1,4 @@
|
||||
from build.ab import emit
|
||||
from build.c import clibrary
|
||||
from build.pkg import package
|
||||
from config import windows, osx, unix
|
||||
@@ -15,6 +16,7 @@ srcs = [
|
||||
"./include/libusbp.h",
|
||||
]
|
||||
deps = []
|
||||
ldflags = []
|
||||
|
||||
if windows:
|
||||
srcs += [
|
||||
@@ -28,6 +30,7 @@ if windows:
|
||||
"./src/windows/list_windows.c",
|
||||
"./src/windows/serial_port_windows.c",
|
||||
]
|
||||
ldflags += ["-lsetupapi", "-lwinusb", "-lole32", "-luuid"]
|
||||
elif osx:
|
||||
srcs += [
|
||||
"./src/mac/async_in_transfer_mac.c",
|
||||
@@ -57,7 +60,8 @@ else:
|
||||
clibrary(
|
||||
name="libusbp",
|
||||
srcs=srcs,
|
||||
cflags=["-Idep/libusbp/include", "-Idep/libusbp/src"],
|
||||
cflags =["-Idep/libusbp/include", "-Idep/libusbp/src"],
|
||||
ldflags=ldflags,
|
||||
deps=deps,
|
||||
hdrs={
|
||||
"libusbp_internal.h": "./src/libusbp_internal.h",
|
||||
|
||||
Reference in New Issue
Block a user