Commit graph

407 commits

Author SHA1 Message Date
Stephen Gutekanst
3549f6bc4d glfw: update Linux system SDKs to include libxkbcommon-dev headers
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
35a9b45e59 glfw: prepare build system to support runtime Wayland/X11 detection
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
bdc12b367d glfw: README: update usage example
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
49f5a26823 glfw: README: mention that we are now tracking glfw@master
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
c45a717a38 glfw: add TODO about glfw@master custom allocator API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
21307a9d1d glfw: update time documentation to glfw@master
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
24f4a9d1c3 glfw: update key documentation to glfw@master
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
5b4b31de13 glfw: update core APIs to glfw@master
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
2db01e1a32 glfw: update native APIs to glfw@master
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
199a3dce78 glfw: update windowing API to glfw@master
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
1dd27fd904 glfw: update monitor API to glfw@master
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
174d244433 glfw: update cursor API to glfw@master
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
4f61a4e3c6 glfw: update build system to glfw@master
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
131caa4cb7 glfw: ensure upstream submodule is cloned
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
214d4cfd6a glfw: upgrade to GLFW@master; add upstream submodule https://github.com/hexops/glfw
This upgrades us to the latest master (pre-release) version of GLFW which has our patches
for undefined behavior in Zig, effectively moving us off of our temporary fork. We now track
GLFW upstream at the revision documented in https://github.com/hexops/glfw/blob/main/VERSION

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Cai Bingjun <1945458160@qq.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
3dd8d028d9 glfw: stop vendoring upstream sources
Moving to the same model we use elsewhere: we now have https://github.com/hexops/glfw
which is a tiny repository with only the sources needed to compile/build/test GLFW on
every platform. It's just the upstream repository at a specific commit, recorded in
the `VERSION` file.

Helps hexops/mach#343

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
iddev5
d3feaed383 glfw: Window: use u32 values for params in setMonitor method 2022-06-11 16:00:02 -07:00
Stephen Gutekanst
322ead9218 CI: ZIG_VERSION=0.10.0-dev.2439+c84f5a5f9 ./dev/update-zig.sh
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-31 05:02:04 -07:00
Stephen Gutekanst
1eab0539d1 CI: correct M1 runner Zig version
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-31 04:11:43 -07:00
Stephen Gutekanst
c2111e0691 CI: ZIG_VERSION=0.10.0-dev.2439+c84f5a5f9 ./dev/update-zig.sh
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-31 03:39:45 -07:00
Stephen Gutekanst
3a81754973 CI: ZIG_VERSION=0.10.0-dev.2439+c84f5a5f9 ./dev/update-zig.sh
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-31 03:24:34 -07:00
Stephen Gutekanst
d3680b6394 glfw: CI: always upgrade Zig M1 CI version
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-31 03:24:34 -07:00
Stephen Gutekanst
bfbc725f0e glfw: CI: standardize M1 CI name
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-31 03:24:34 -07:00
d3m1gd
25022a1471 glfw: move git check 2022-05-30 10:24:09 -07:00
d3m1gd
5549388e57 glfw: ensure git present 2022-05-30 10:24:09 -07:00
kamidev
68190e863a Change std.build.Pkg.path -> std.build.Pkg.source
Fixes breaking change in latest Zig master, see https://github.com/ziglang/zig/pull/11557
2022-05-29 08:25:52 -07:00
Lee Cannon
4570838304
Update to latest Zig master (0.10.0-dev.2017+a0a2ce92c) (#261)
* use `@ceil` instead of `std.math.ceil`
* `ChildProcess.init` does not allocate anymore
* update CI zig version
* examples: temporarily switch to fork of zigimg compatible with zig-master

Commands executed:

```
git submodule set-url -- examples/libs/zigimg https://github.com/slimsag/zigimg
git submodule set-branch --branch zig-master -- examples/libs/zigimg
git submodule update --init --remote examples/libs/zigimg
```

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-01 11:44:27 -07:00
Stephen Gutekanst
89c9c6c8e1 CI: correct YAML syntax / regression
Helps hexops/mach#248

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-21 03:41:38 -07:00
Stephen Gutekanst
7ebe8cde5e glfw: zig fmt
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-20 23:01:39 -07:00
iddev5
bb65083561 CI: dont run aarch64-mac workflow on forks
The workflow uses a self hosted runner which is only available for
hexops/mach* repositories. Without this commit, whenever a fork of mach
or mach-* were pushed, it would queue an aarch64-mac job and then crash
after one day due to no machines being found.
2022-04-19 20:12:22 -07:00
Stephen Gutekanst
b2ac779180 glfw: update vulkan headers to latest (adds v1.3 support)
Produced via `./update-upstream.sh`

Helps hexops/mach#236

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-18 20:44:34 -07:00
iddev5
27146af8ce glfw: add getErrorString() to access the current error description 2022-04-17 10:49:05 -07:00
Isaac Freund
02e357ab44
build: never use pkg-config to link system libraries (#217)
Every library we want to link against is either provided by the Zig
toolchain or part of our SDK. Therefore, using pkg-config to link
against libraries on the host system is never what we intend.

To fix this, use linkSystemLibraryName() everywhere instead of
linkSystemLibrary() as the latter integrates with pkg-config while the
former just passes -lfoo to the zig compiler.

In combination with Zig commit 38d6e1d8a8 fixing an std.build bug,
this change fixes the linking of the necessary X11 libraries on my
x86_64 glibc based Void Linux system.
2022-04-12 12:08:30 -07:00
Stephen Gutekanst
d2d5bdc892 glfw: zig fmt
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-08 16:54:37 -07:00
Silver
017ca6dd08 glfw: add type to pkg def in build.zig 2022-04-07 18:42:15 -07:00
Stephen Gutekanst
0161ccef37 glfw: add std.build.Pkg definition
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-05 00:16:51 -07:00
Mitchell Hashimoto
d26c76b074 system_sdk for linux-aarch64 2022-03-30 10:05:58 -07:00
Stephen Gutekanst
0753c5e4c8 glfw: update to Zig 0.10.0-dev.1600+af844931b
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-26 13:31:24 -07:00
Stephen Gutekanst
2288fa8d78 glfw: CI: windows: disable progress bar for faster downloads
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-26 13:25:56 -07:00
BratishkaErik
1838faf3f9
glfw: add instructions for Gyro in README.md (#184)
* glfw: add instructions for Gyro in README.md
2022-03-19 07:43:23 -07:00
Stephen Gutekanst
38b896ed83 glfw: CI: uninstall libx11 on x86_64-macos to avoid conflicts
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-06 02:10:07 -07:00
Stephen Gutekanst
09579e649d Revert "glfw: system_sdk: use addIncludeDir over addSystemIncludeDir"
This reverts commit 5f382f9365.

I forgot that system include dirs also silence some warnings that are
present in system headers, so we can't really do this.
2022-03-06 02:05:45 -07:00
Stephen Gutekanst
5f382f9365 glfw: system_sdk: use addIncludeDir over addSystemIncludeDir
Since we're not specifying a sysroot by default (as that prevents
making use of other libraries/headers on your system, if you wish to)
we can have conflicts with either the headers on your system or the
headers Zig itself ships (although that shouldn't happen, except for
cases like Windows where we ship more up-to-date DirectX headers.)

System include dirs are treated with the same relative priority as other
system include dirs, those actually on your system and the ones Zig
provides. But regular include dirs are given higher priority, and so
should give our headers a better chance of being included in the event
that there should be any conflict.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-06 01:56:45 -07:00
Stephen Gutekanst
057937a066 glfw: clone with -c core.longpaths=true for Windows
Yes, even in 2022 we're still dealing with Windows filepaths being too long.
The repository can't clone on GitHub actions Windows CI runner, currently,
because of this issue. https://stackoverflow.com/a/22575737

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-05 03:30:33 -07:00
Stephen Gutekanst
07dbd1a18f glfw: CI: update to latest Zig master
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-05 03:04:41 -07:00
Stephen Gutekanst
020ee37686 glfw: update system_sdk notes
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-04 16:35:43 -07:00
Stephen Gutekanst
6cbf0508b1 glfw: system_sdk: add Windows system SDK with updated DirectX headers
This effectively provides all you need to develop & cross compile DirectX 11/12
applications with `mach/glfw` (or just Zig in general, by copying `system_sdk.zig`
into your own project.)

Helps hexops/mach#86
Helps hexops/mach#59

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-04 16:26:58 -07:00
Stephen Gutekanst
d35957766b glfw: use lowercase shell32 for Linux
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-04 16:10:51 -07:00
Stephen Gutekanst
16c581b2ab glfw: fix x86_64-windows-msvc compilation support
This fixes compilation for msvc ABI. This currently only works under Windows,
I believe because Zig requires the Windows SDK to be present for msvc compilation
/ does not allow cross compilation with MSVC. Still, this is nice to have.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-04 15:59:36 -07:00
Stephen Gutekanst
646560c834 glfw: remove alignment from packed structs / fix compilation with latest Zig
Not sure why we had these here, but alignment on a packed struct seems somewhat
nonsensical (after all, it's fields are packed as closely together as possible
so what would alignment refer to?) removing seems fine and fixes compilation with
latest Zig:

```
/Users/slimsag/Desktop/hexops/mach/gpu-dawn/libs/mach-glfw/src/hat.zig:8:20: error: unable to override alignment of packed struct fields
    up: bool align(@alignOf(u8)) = false,
                   ^
/Users/slimsag/Desktop/hexops/mach/gpu-dawn/libs/mach-glfw/src/mod.zig:10:23: error: unable to override alignment of packed struct fields
    shift: bool align(@alignOf(c_int)) = false,
```                      ^

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-04 15:48:40 -07:00