Commit graph

278 commits

Author SHA1 Message Date
Ali Chraghi
3947e51025 build: set rdynamic=true to export symbols 2023-01-23 00:20:54 -07:00
Ali Chraghi
8a15fcd694 gpu-dawn: update for building latest dawn 2023-01-14 12:12:00 -07:00
Ali Chraghi
1d7cd4be80 mach: fundamental changes
- Core doesn't depend to `App` anymore
 - `setOptions` has replaced with some new functions (`setTitle`,
   `setSize`, etc)
   - and more
2023-01-12 01:54:48 -07:00
Stephen Gutekanst
a750e31d11 Revert "all: build: fix sdkPath for relative @src.file / fix autocompletion with ZLS / IDEs (#661)"
This reverts commit a1fe671db8.

Lue suggested reverting #661 because ZLS worked around the issue of @src
being relative in that environment: https://github.com/zigtools/zls/pull/898

This is not a perfect solution (what zls did seems to be a workaround), but
is good enough for us until Zig gets an official package manager.
2023-01-10 01:57:52 -07:00
Lue
a1fe671db8
all: build: fix sdkPath for relative @src.file / fix autocompletion with ZLS / IDEs (#661)
* all: build: fix sdkPath for relative @src.file

Prior to this commit, the build system heavily assumed that the result
`@src.file` would always be absolute, but this is no longer
guaranteed, likely due to there being no such thing as an "absolute
path" in WASI.

It appears that for normal invocations of `zig build`, it is safe to
assume that `@src.file` is absolute. However, when ZLS uses a custom
`build_runner.zig` to collect build configuration, `@src.file` is
actually relative to the current working directory, at least on my
system. For a while, this led to ZLS completions breaking entirely,
but presently it actually causes ZLS to crash!

The solution is not as simple as using relative `sdkPath` results
as-is, because the build system may attempt to resolve these paths
relative to build root, when the paths are actually relative to the
current working directory.

This leads to a sticky situation: the current working directory is a
runtime concept, but `@src.file` is resolved at compile time. However,
it appears that the build runner does not change current working
directory in between compilation and execution, so it is probably safe
to calculate `sdkPath` using runtime current working directory.

Still, this requires major changes with how `sdkPath` works, since
runtime computation and allocations are required. So pretty much
anything that relied on `sdkPath` being comptime-known has been
refactored in this commit.

The most severe result of this is that, for example, `gpu.pkg` can no
longer be a comptime-known constant: it has to be a runtime function
that takes a `*Builder` and returns a `Pkg`.

This commit deals with usages of `*.pkg` and `sdkPath` within Mach
itself, but projects that depend on Mach such as `mach-examples` will
almost certainly require changes as well.

* all: update README to reflect change in pkg usage

For details on updating your code to use this version, see: 88b1106953

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-02 01:23:46 -07:00
Ali Chraghi
c4842ea5c5 build: replace App.setBuildMode() with mode option 2022-12-27 12:53:00 -07:00
Ali Chraghi
2de36ad75b wasmserve: execute zig with acutal args 2022-12-25 13:36:03 -07:00
Ali Chraghi
061daa790f ci: remove compile-all step
examples are moved to a separate repo and `zig build` does the same
2022-12-25 13:36:03 -07:00
Aaron Winter
ef05d8ca69
mach: toOwnedSlice now returns an error union that needs to be handled (#635) 2022-12-10 15:26:16 -07:00
Keith Chambers
cb011d961b
mach: fix missing param when linking model3d (#617) 2022-11-14 18:15:16 -07:00
Keith Chambers
731e2b1287
{mach,model3d}: link model3d as static lib instead of adding C files to build step (#613)
This allows the library to link better with projects. Otherwise you can end up with a mix of conflicts over that compiler + version to use.

Also adds .use_model3d option to mach build system. If set to true, model3d will be linked in statically to target project.
2022-11-14 15:43:53 -07:00
Stephen Gutekanst
18bc25502b mach: update mach-test dependencies
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-11-05 13:32:50 -07:00
Stephen Gutekanst
6a45971c6f trimesh2d: remove in favor of mach/earcut library
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-31 12:12:01 -07:00
Stephen Gutekanst
96c2e35ab3 all: integrate earcut library
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-31 12:12:01 -07:00
Ian Applegate
6563739d1a
mach: build: fix init error type. append can return OutOfMemory (#604) 2022-10-31 08:15:56 -07:00
Ali Chraghi
3ea1dea4f7
model3d: add m3d implementation / bindings (#589) 2022-10-21 07:42:01 -07:00
Stephen Gutekanst
af357c0a8a mach: expose trimesh2d package
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-19 07:30:11 -07:00
Stephen Gutekanst
96a9c94922 mach: zig fmt
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-16 12:54:40 -07:00
Stephen Gutekanst
023170352f mach: add optional freetype linking
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-16 12:45:33 -07:00
Stephen Gutekanst
189997c279 {mach,examples}: move examples to github.com/hexops/mach-examples
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-16 12:21:50 -07:00
Stephen Gutekanst
1e87b2b78a mach: ecs now builds with self-hosted compiler
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-15 07:54:29 -07:00
Ali Chraghi
82e10f4f28
all: build: thisDir improvements (#570)
* build:all: thisDir improvements

more performant output, usage code reducement and compileError for wrong usage

* glfw: update deprecated code
2022-09-29 08:41:46 -07:00
Ali Chraghi
fcb82345d4
all: build: organize build files and reduce unreachables (#567) 2022-09-25 10:02:51 -07:00
Ali Chraghi
728582c75e build: only build/run tests and libmach on non-wasm targets 2022-09-20 02:30:45 -07:00
Ali Chraghi
1a6a82e11b build: ensure cubemap assets submodule 2022-09-20 02:30:45 -07:00
Ali Chraghi
9f6c4bf7b1 build: fix compilation errors
this should make linux CI green
2022-09-20 02:30:45 -07:00
Ali Chraghi
2ab3516795 gamemode: use zig build 2022-09-18 17:09:54 -07:00
Ali Chraghi
6043c7eae6
mach: add is_app option to disable gamemode in desktop applications; use parseIp4 (#544)
* mach: add `is_app` option to disable gamemode in desktop applications
* use parseIp4 instead of resolveIp (which throws a compile error in windows)
2022-09-16 23:32:27 -07:00
Diego Arias
eef76effe3 examples: add pixel post processing effect example 2022-09-16 16:49:20 -07:00
Ali Chraghi
8b50f076a6 {build,wasmserve}: improvements
build: use parseIp4 instead resolveIp
wasmserve: use ansi_to_html.js instead ansi_up.js
wasmserve: handle build procces unexpected exits and more
2022-09-15 07:42:59 -07:00
praschke
b0cd4ec1a0
all: fix pointless discards; typo; fix libmach compilation on Linux (#541) 2022-09-15 07:41:05 -07:00
Ali Chraghi
aaddd4dbeb {build,wasmserve}: show error on browser + improvements 2022-09-14 12:32:03 -07:00
Ali Chraghi
5be9f04d85 {build,wasmserve}: use wasmserve, drop apple_pie 2022-09-14 12:32:03 -07:00
Stephen Gutekanst
8af0c9a6a8 mach: correctly link sysaudio to all Apps
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-11 00:17:52 -07:00
NewbLuck
f15cea9492
examples: add cubemap example (#523)
Co-authored-by: Scott Johnson <scott.johnson@furniturerow.com>
2022-09-09 22:41:24 -07:00
Stephen Gutekanst
2ba7e48ac2 {sysjs,mach}: correctly pass sysjs dependency to sdk
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-09 21:55:38 -07:00
Stephen Gutekanst
4a421b8130 mach: update to latest sysaudio SDK API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-10 04:06:16 +00:00
NewbLuck
46c4ea4ebd
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
06b0609ada examples: add triangle-msaa 2022-09-07 21:25:35 -07:00
Ali Chraghi
0c54bc740f build: add glfw test step 2022-09-07 21:24:47 -07:00
praschke
125aeff7f1 gpu-dawn: default to release version of Dawn 2022-09-06 20:54:22 -07:00
Ali Chraghi
80266c577e build: make libs tests seprate step 2022-08-29 05:59:52 -07:00
Stephen Gutekanst
587ea05d1e examples: add sysaudio piano example
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-28 23:37:56 -07:00
Stephen Gutekanst
2e61125601 mach: expose sysaudio/sysjs packages
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-28 23:37:56 -07:00
Ali Chraghi
5cf7569767 build: fix gamemode package path 2022-08-27 11:05:36 -07:00
Ali Chraghi
b9e00fdbb6 build: fix memory leaks 2022-08-27 11:05:36 -07:00
Stephen Gutekanst
6e881b21a6 mach: reference new libs/ subproject path
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-26 15:12:04 -07:00
Ali Chraghi
4a0802639c
basisu: add bindings for basis-universal (supercompressed textures) (#477) 2022-08-25 03:56:06 -07:00
LordMZTE
a001d53576 examples: fix old example assets directory paths
This commit fixes a bug where the build script would look for
an assets directory that has been moved.
2022-08-22 19:52:46 -07:00
Stephen Gutekanst
bc5e2fe9bf examples: workaround change in @embedFile not working with relative paths
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-20 22:48:19 -07:00