diff --git a/CMakeLists.txt b/CMakeLists.txt index 606b5bc1..b30926a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,17 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) +# A newer MSVC (windows-latest) emits C4875 ("a non-string literal argument to [[gsl::suppress]] is +# deprecated") from the vendored GSL headers, which several targets compile with warnings-as-error. +# Suppress this dependency-side deprecation so the Windows build isn't broken by toolchain drift. Must +# be set before arcana.cpp / Core / Polyfills are added below so they inherit it. Scoped to C++ (the +# warning only fires for GSL's C++ [[gsl::suppress]] attribute); kept directory-wide because GSL is +# pulled in transitively by many targets (arcana, AppRuntime, the polyfills) and no first-party code +# uses a non-string [[gsl::suppress]], so this doesn't mask our own warnings. +if(MSVC) + add_compile_options($<$:/wd4875>) +endif() + # -------------------------------------------------- # Options # -------------------------------------------------- diff --git a/Core/Node-API-JSI/CMakeLists.txt b/Core/Node-API-JSI/CMakeLists.txt index e8e79a96..cb851d62 100644 --- a/Core/Node-API-JSI/CMakeLists.txt +++ b/Core/Node-API-JSI/CMakeLists.txt @@ -57,7 +57,13 @@ if(NOT TARGET jsi) endif() target_include_directories(napi - PUBLIC "include") + PUBLIC + "include" + # napi.h pulls in the shared , which lives in + # Core/Node-API/Include/Shared. That sibling isn't built when the engine is JSI + # (Core/CMakeLists.txt selects Node-API-JSI instead of Node-API), so reference the shared + # headers directly here -- otherwise the JSI napi fails to compile with C1083. + "${CMAKE_CURRENT_SOURCE_DIR}/../Node-API/Include/Shared") target_link_libraries(napi PUBLIC jsi)