Closed saikyun closed 2 years ago
I got similar output for jpm 1cd77f9: jpm-build-output.txt
I'm on windows, and I was able to build. Not sure this a jpm issue? Perhaps try with the latest jpm, but I wouldn't expect that to help
@bakpakin Thanks for taking a look and the pointer.
I tried building and using various versions of Janet and found that there appears to be a commit beyond which jaylib won't build here.
The following is a list of commits that seem relevant starting with the most recent and going back in time:
The first one https://github.com/janet-lang/janet/commit/d631d29cb4f79d37f594e7f4e482c49549bc1627 is the first commit I was able to confirm jaylib not building for.
The next two https://github.com/janet-lang/janet/commit/01b7891347f752322b82fa724fe03dde7384bdcf and https://github.com/janet-lang/janet/commit/c786a4cbeb8b4384111bde2fbe6113a7b2e06998 were commits where Janet itself didn't build on Windows.
The last one https://github.com/janet-lang/janet/commit/1920ecd668fab77003a7e454fc44fc94d3cdd0f5 is the last commit I confirmed for which jaylib still builds on Windows.
(FWIW, I tried with both the old Janet-bundled jpm and the most recent jpm from the independent repository and the results were the same. So jpm does not appear to be causing issues.)
webview appears to be affected similarly, i.e. it builds with https://github.com/janet-lang/janet/commit/1920ecd668fab77003a7e454fc44fc94d3cdd0f5 but not with https://github.com/janet-lang/janet/commit/d631d29cb4f79d37f594e7f4e482c49549bc1627 .
I would guess that it had to with janet.h now including windows.h. windows is a bit picky about the order of includes, so this can break some code. Instead, we should be able to do a forward define of CRITICAL_SECTION. (The change is to allow use of JanetOSMutex from libraries, which is useful for writing thread aware libraries).
Thanks for taking a look.
I found this SO answer and some code at WindowsHModular.
So may be part of what's necessary is replacing the #include <windows.h>
in janet.h
with:
typedef struct _RTL_CRITICAL_SECTION RTL_CRITICAL_SECTION;
typedef RTL_CRITICAL_SECTION CRITICAL_SECTION;
Since this commit in Janet, jaylib builds for me in Windows.
TYVM!
May be @saikyun can close this issue.
Builds for me too, thank you so much!!
When building jaylib on newest jpm (using
jpm build
) on Windows, I get errors like this: