How to use SWIG to generate JSB code

  1. What is the right version of swig.exe
  2. Is that lack of includeDirs for swig-config.js
  3. The swig.exe show me the error:
    PS C:\Code\cocos-engine\native\tools\swig-config> node .\genbindings.js
    ==> WORK_DIR: C:\Code\cocos-engine\native\tools\swig-config
    ==> SCRIPT_DIR: C:\Code\cocos-engine\native\tools\swig-config
    ==> COCOS_NATIVE_ROOT:C:\Code\cocos-engine\native
    ==> platform: win32
    ======================================================================
    ==> Generate Bindings: interface: C:\Code\cocos-engine\native\tools\swig-config\2d.i, output cpp: C:\Code\cocos-engine\native\cocos\bindings\auto\jsb_2d_auto.cpp
    ==> exe: C:\Code\GWCPEngine\external\swigwin-4.0.1\swig.exe
    ==> swigArgs: -c++ -cocos -fvirtual -noexcept -cpperraswarn -D__clang__ -Dfinal= -DCC_PLATFORM=3 -Dconstexpr=const -DCC_PLATFORM_ANDROID=3 -IC:\Code\external\swigwin-4.0.1\Lib -IC:\Code\external\swigwin-4.0.1\Lib\javascript -IC:\Codeswig error : Unrecognized option -cocos
    Use ‘swig -help’ for available options.
    ==> ERROR: spawnSync returns 1

I use the develop branch, current commit id is c4be6be29d0ea5bafcf75a9082d1054958de4e9b


path: 3.7.1\resources\resources\3d\engine\native\external\win64\bin\swig\share\swig\4.1.0\