> On Apr 22, 2020, at 13:55, キャロウ マーク <[email protected]> wrote:
> 
> 
> 
>> On Apr 21, 2020, at 22:08, キャロウ マーク <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> 
>> 
>>> On Apr 21, 2020, at 16:55, キャロウ マーク <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>> 
>>> Yes this seems like a really simple and stupid question, bear with me.
>>> 
>>> The documentation 
>>> https://emscripten.org/docs/porting/connecting_cpp_and_javascript/WebIDL-Binder.html
>>>  
>>> <https://emscripten.org/docs/porting/connecting_cpp_and_javascript/WebIDL-Binder.html>
>>>  just has a link to the source for the binder in the Emscripten GitHub 
>>> repo. It says nothing about how you actually use it. Typing 
>>> `webidl_binder.py` even prefixed with `python` gets a not found error. A 
>>> `find` in my emsdk root reveals the tool is in upstream/emscripten/tools. 
>>> The emsdk installer did not add the directory to $PATH from which it seems 
>>> you aren’t meant to run it directly. However I can’t find any options in 
>>> emcc to run the binder and it proclaims ignorance of the `.idl` extension 
>>> if I just pass the file to it.
>>> 
>>> So, am I supposed to add  `upstream/emscripten/tools` to my $PATH or is 
>>> there another way I’m supposed to run it. If the former, why doesn’t emsdk 
>>> add this directory to $PATH?
>>> 
>> 
>> I discovered that I copied the emsdk $PATH additions into my .bash_profile - 
>> because I want them visible to something called osx-env-sync.sh. It is 
>> possible that a more recent `emsdk construct_env` may be adding the tools 
>> directory.
>> 
>> However webidl_binder.py does not have a #! line so can’t be run as a shell 
>> plus it does not have execute permission (I’m using a clone of the 
>> Emscripten repo) making it very difficult to run from the command line. 
>> Surely there must be a simpler way than `python 
>> $EMSDK/upstream/emscripten/tools/webidl_binder.py`. Yes I know I can make 
>> aliases and scripts, etc. etc. but why should I have to. I don’t have to in 
>> order to run `emcc`.
>> 
> 
> I am running the binder the long-winded way. I am finding that it is leaving 
> little turds behind, a file called “parser.out” and another called 
> “WebIDLGrammar.pkl”.
> 
> So I repeat my question. What is the proper way to run the binder? Will that 
> still leave turds behind? Why the silence? Isn’t anyone else using this or do 
> you all think my question so dumb it doesn’t deserve an answer?

The binder is emitting the following code into the .cpp file:

void array_bounds_check(const int array_size, const int array_idx) {
  if (array_idx < 0 || array_idx >= array_size) {
    EM_ASM({
      throw 'Array index ' + $0 + ' out of bounds: [0,' + $1 + ')';
    }, array_idx, array_size);
  }
}

emcc barfs on " '$' in identifier [-Wdollar-in-identifier-extension]”. 
WebIDL-Binder.html says nothing about either EM_ASM or ‘array_bounds_check’. 
And I don’t see any flag to emcc relevant to enabling ASM_JS. How do I fix this?

I feel like I’m blazing a new trail here yet there are examples pointed at by 
WebIDL-Binder.html. However I was unable to find the build scripts, .yml files 
make fles or whatever, for either of the examples.

Regards

    -Mark

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/EDD7D00E-4DC6-4025-8D55-11A914BE7F68%40callow.im.

Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to