Commit graph

42 commits

Author SHA1 Message Date
Ali Chraghi
c41258ec6b system_sdk: update to latest revision 2023-01-20 14:53:22 -07:00
Ali Chraghi
d7a16e5078 system_sdk: update to latest revision 2023-01-14 12:12:00 -07:00
Ali Chraghi
ce396a5e8c system_sdk: update to latest commits 2022-12-18 18:02:31 -07:00
Stephen Gutekanst
d59cc605e8 system-sdk: use macOS 12 SDK for macOS 13 for now
Fixes hexops/mach#606

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-11-25 10:31:04 -07:00
Cameron Murtagh
d2358e8edf glfw: system_sdk: bump max major linux version (#602) 2022-10-29 10:50:13 -07:00
Ali Chraghi
c20d377711 system_sdk: better target check 2022-10-27 16:50:30 -07:00
Kami Development
ef5d8b12e7 glfw: fix compilation with latest zig master (#574)
See 0b1dd845d9
2022-10-14 08:55:15 -07:00
Ali Chraghi
b4799cfd5a all: prefix environment variables with MACH_ 2022-10-11 00:59:23 +02:00
Stephen Gutekanst
771275a553 glfw: update Linux system SDKs for mach/sysaudio
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-10 04:06:16 +00:00
NewbLuck
3b15e261a4 all: update to use latest Zig master APIs (#521)
Co-authored-by: Scott Johnson <scott.johnson@furniturerow.com>
2022-09-10 02:07:30 +00:00
Ali Chraghi
6de027bb40 build: replace depracted functions 2022-08-27 11:12:07 -07:00
Stephen Gutekanst
27a90d81f5 glfw: update Linux system SDKs (update vulkan-headers to v1.3.224)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-06 21:39:49 -07:00
Stephen Gutekanst
3184357f27 glfw: update Windows system SDK for Dawn compilation (reduce rpcndr_hack)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-06 20:16:28 -07:00
Stephen Gutekanst
1dc7601e37 glfw: update Linux system SDKs for Vulkan v1.3 headers
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-06 03:19:39 -07:00
Stephen Gutekanst
859ec51a2f glfw: update Linux system SDKs for newer Vulkan headers
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-06 02:40:08 -07:00
Stephen Gutekanst
bf445c448b glfw: fix caching bug in system_sdk that prevents cross-compilation in some situations
Prior to this change, cross-compiling Mach to other OSes was not working due to a regression.
e.g. to windows:

```
zig build -Dtarget=x86_64-windows run-example-boids
LLD Link... error(link): DLL import library for -ldxguid not found
error: DllImportLibraryNotFound
error: example-boids...
```

The problem was that one build step may invoke `getSdkRoot` and the target might be for say macOS,
since it's building e.g. GLFW for macOS as the target of tests, and `getSdkRoot` would cache the
SDK root _forever_ as being the macOS SDK (in an attempt to avoid running the various git commands
needed to resolve the SDK root multiple times, which slows builds down.)

We instead need to cache the SDK root per step, because the target may not be the same.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-07-22 19:30:59 -07:00
Stephen Gutekanst
385f718127 glfw: update macOS system_sdk to include AudioToolbox
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-07-01 19:05:27 -07:00
PiergiorgioZagaria
d7c4c730ad glfw: update system_sdk for wayland and catch wayland test errors 2022-06-29 20:54:04 -07:00
Stephen Gutekanst
05d77de3a4 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
d3m1gd
66f8c4960e glfw: move git check 2022-05-30 10:24:09 -07:00
d3m1gd
8493ce0e75 glfw: ensure git present 2022-05-30 10:24:09 -07:00
Lee Cannon
dae779de57 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
Mitchell Hashimoto
46acc7c0b4 system_sdk for linux-aarch64 2022-03-30 10:05:58 -07:00
Stephen Gutekanst
db933d8e4d Revert "glfw: system_sdk: use addIncludeDir over addSystemIncludeDir"
This reverts commit 5f382f93658585d176bff75672412e4c57aa2f17.

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
03429eebca 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
a2ca643c79 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
d6bf154e4c glfw: update system_sdk notes
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-04 16:35:43 -07:00
Stephen Gutekanst
9ff7cd0fdf 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
Ali Chraghi
0028045cda add wayland cross-compilation support (#140)
* add wayland-headers include path
* add wayland protocols header to wayland target includes
* move `xkb_unicode.c` to `sources_linux.c`
* glfw: document where wayland generated sources come from
* glfw: update sdk-linux-x86_64 to include Wayland protocol sources

See https://github.com/hexops/sdk-linux-x86_64/pull/2

Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2021-12-24 01:06:51 -07:00
Stephen Gutekanst
59ba9ec476 glfw: improve consecutive build times by 4-12x
This substantially reduces consecutive build times when using mach/glfw.

`system_sdk.getSdkPath` is frequently invoked as part of the build process, and previously it was
doing some fairly involved work (ensuring the native SDK is at the right revision, needless
`git fetch` in native SDKs to check for updates, etc.)

We now do far less work in `getSdkPath`, and additionally cache the result in-memory. This improves
build times substantially, but especially so with consecutive (non-cold-cache) build times:

* For `mach/glfw`: ~2s before, ~160ms after
* For `mach/gpu`: , ~16s before, ~3.6s after

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-12-10 03:40:00 -08:00
BratishkaErik
1667cbb8ff glfw: update system_sdk.zig to latest Zig master 2021-12-06 20:03:38 -08:00
Stephen Gutekanst
ef6de0e00f glfw: update Linux SDK (enforce static linkage of libvulkan and libX11-xcb)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-12-01 04:04:19 +00:00
Stephen Gutekanst
552a6b75ef glfw: update Linux system SDK
Helps hexops/mach#87

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-30 16:56:15 -07:00
Stephen Gutekanst
84382ee1fc glfw: update system SDKs for macOS 11 cross compilation
Fixes hexops/mach#108

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-29 21:24:22 -07:00
Stephen Gutekanst
a544741a50 glfw: do not pin SDK version when using custom dev SDK path
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-29 21:24:22 -07:00
Stephen Gutekanst
7465bb6e93 glfw: make system_sdk pin versions, auto-update
Prior to this change, an older commit of Mach or mach-glfw would use the latest
version of the native system SDKs, which would sometimes be incompatible. Better
is to ensure that we actually pin the revision we're using, so a given revision
of mach or mach-glfw is using a specific revision of the native SDKs.

Similarly, we previously had no mechanism for updating SDKs: it was either cloned,
or it wasn't. This introduces a simple `git fetch` prior to hard-resetting the SDK
to the target pinned revision - effectively giving us automatic updates for anyone
using an older revision.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-28 18:43:58 -07:00
Stephen Gutekanst
ea3b28efc7 glfw: rename system_sdk.Options.linux_x86_64_sdk for consistency
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-28 18:43:58 -07:00
Stephen Gutekanst
6910608980 glfw: correct Apple SDK license prompt
Prior to this the Apple SDK license agreement prompt would appear for 11.3 but
not 12.0 by accident. This fixes the issue.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-28 18:43:58 -07:00
Stephen Gutekanst
95515eaf7c glfw: update system_sdk to match latest Zig master macOS version targeting
The latest Zig master supports specifying a specific macOS version for libc, via
the target triple (ziglang/zig#10215):

* x86_64-macos.10 (Catalina)
* x86_64-macos.11 (Big Sur)
* x86_64-macos.12 (Monterey)
* aarch64-macos.11 (Big Sur)
* aarch64-macos.12 (Monterey)

Mach's `system_sdk.zig` can now download the relevant XCode framework stubs
for Big Sur (11) and Monterey (12). Although we don't have an SDK for Catalina (10)
currently, we use the Big Sur (11) SDK in that case and it generally works fine.
By default, Zig targets the N-3 version (e.g. `x86_64-macos` defaults to `x86_64-macos.10`).

Targeting the minimum supported version is useful for compatability, it guarantees the produced
binary will run on any later macOS version. Targeting the newer version can be useful if you
wish to use newer APIs not available in previous versions.

Fixes hexops/mach#102

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-27 00:15:15 -07:00
Stephen Gutekanst
5aa3e2a66e glfw: update system_sdk to use latest MacOS 12.0 SDK
Updates us to using the newer SDK https://github.com/hexops/sdk-macos-12.0

Also enables cross-compilation of the `mach/gpu` backend for macOS.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 12:31:55 -07:00
Stephen Gutekanst
1ec1b7dfc4 glfw: zig fmt
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-31 01:00:56 -07:00
Stephen Gutekanst
e752666062 glfw: refactor system SDK inclusion into helper file
This refactors the logic for system SDK inclusion out of the GLFW-specific `build.zig`,
and should make it very easy for anyone to copy this file and start getting cross-platform
builds of their own OpenGL/Vulkan Zig projects.

There may be some libraries we need to add for Vulkan to these SDKs, I haven't yet tested
that - but the overall idea here seems sound.

Fixes hexops/mach#39

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-30 21:31:52 -07:00