Fix Visual Studio builds after migration to SpiderMonkey 102.x
Hi,
This attempts to fix the build of the GJS sources against SpiderMonkey 102.x. This is the continuation of 1-basically what is done:
- Require Visual Studio 2019 16.5.x or later, since we need to use the newer preprocessor (
/Zc:preprocessor
) in order to build against the SpiderMonkey 102.x headers. - Fix builds against glib-2.68.x or later, since for Visual Studio builds it is considered an error to return a value in a void-retype function (see glib's
msvc_recommended_pragmas.h
, wherewarning C4098
is considered an error).
What probably needs to be done in GJS as a whole (i.e. for all builds):
- We might need to depend on a newer GLib/G-I, as newer items from there seemed to be used (I might be wrong). It did seem to me that for the introspection to work, we must use g-i
main
or the very latestgnome-42
branch, since the introspection data was updated after 1.72.0 (thegnome-42
release) was released. - Examples might need an update, or I missed something, as in 1. Same goes if I used
clang-cl
without the change inmozilla/EnumSet.h
, as noted below. I will try on a Linux system to double-check whether I missed something.
What needs to be done in upstream SpiderMonkey:
- The generated header that should be installed during SpiderMonkey's build process
ProfilingCategoryList.h
is missing. - Update
mozilla/EnumSet.h
to either drop thestatic constexpr
or fix things otherwise in line 329, as noted in 1.
With blessings, thank you!
Edited by Chun-wei Fan