Skip to content

Fix Windows/UWP CI build (MSVC C4875 + JSI include path)#185

Open
matthargett wants to merge 3 commits into
BabylonJS:mainfrom
rebeckerspecialties:fix-windows-uwp-ci
Open

Fix Windows/UWP CI build (MSVC C4875 + JSI include path)#185
matthargett wants to merge 3 commits into
BabylonJS:mainfrom
rebeckerspecialties:fix-windows-uwp-ci

Conversation

@matthargett
Copy link
Copy Markdown

@matthargett matthargett commented Jun 5, 2026

Two pre-existing build-config fixes that unbreak the Win32/UWP CI; no functional changes. We hit these
while expanding N-API version support (cf. #116, #183) but they're independent of that work.

  • MSVC C4875: a newer MSVC promotes the deprecated non-string-literal [[gsl::suppress]] argument
    (from the vendored GSL headers) to an error under /WX, breaking every Win32/UWP build. Suppress it.
  • JSI include path: add the shared Core/Node-API/Include/Shared to the JSI napi target so
    napi.h can find <napi/js_native_api_types.h> (was failing with C1083).

Landing sequence

Inter-related N-API PRs; intended order (✅ done / ⏳ pending):

  1. Fix Windows/UWP CI build (MSVC C4875 + JSI include path) #185 — Fix Windows/UWP CI build (MSVC C4875 + JSI include path). Independent build/toolchain fix; lands first so CI is green under everything below. (fork twin build: fix pre-existing Windows/UWP CI build failures (MSVC C4875 + JSI include path) rebeckerspecialties/JsRuntimeHost#5 — 22/22 green)this PR
  2. Build napi as a shared library on Android #183 — Build napi as a shared library on Android (so in-process addons resolve napi_*).
  3. Add N-API compliance tests #116 — N-API compliance tests (the Android addons resolve napi_* via the shared libnapi.so from the step above).
  4. N-API v7 across runtimes (V8 / JSC / Chakra)N-API v7 across runtimes (V8 / JavaScriptCore / Chakra) #189 (draft) — fork CI twin N-API v7 across runtimes (V8 / JavaScriptCore / Chakra) rebeckerspecialties/JsRuntimeHost#4, 22/22 green.

Motivating RFCs: rebeckerspecialties#6 (jsc-android → maintained JSC) · rebeckerspecialties#7 (WebWorker via N-API → Factotum into BabylonNative).

…uild

windows-latest's newer MSVC promotes C4875 (deprecated non-string [[gsl::suppress]] arg) from the
vendored GSL headers to an error under /WX, breaking every Win32/UWP build (pre-existing on main).
Suppress the dependency-side deprecation.
…ng JSI C1083)

The JSI napi target only had its own include/ on the include path, but napi.h includes the shared
<napi/js_native_api_types.h> from Core/Node-API/Include/Shared (not built when the engine is JSI). Add
that directory so the JSI backend compiles. Pre-existing failure (JSI was red on main with the same
C1083); unblocks Win32/UWP JSI.
Copilot AI review requested due to automatic review settings June 5, 2026 20:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Update CMake configuration to fix JSI Node-API builds by adding missing shared header include paths and to keep Windows CI green by suppressing a new MSVC warning coming from vendored GSL headers.

Changes:

  • Add Core/Node-API/Include/Shared to the include path for the napi target in the Node-API-JSI build.
  • Suppress MSVC warning C4875 globally to avoid warnings-as-errors failures on newer toolchains.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
Core/Node-API-JSI/CMakeLists.txt Adds missing shared include directory so JSI builds can find js_native_api_types.h.
CMakeLists.txt Adds MSVC compile option to suppress C4875 emitted by vendored GSL headers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Core/Node-API-JSI/CMakeLists.txt Outdated
Comment thread CMakeLists.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants