Generally yes, but the devil is in the details :)

If you have a code base that compiles and runs both on Windows *and* Linux, 
that's a pretty good starting point. Usually it's Windows-centric code that 
requires a lot of work.

The problem isn't only that emscripten doesn't have definitions for 
platform-specific features, more important is that WebAssembly doesn't give 
you access to 'native' platform features because it's running in the 
browser sandbox for security reasons.

On Monday, 3 September 2018 15:22:28 UTC+2, Varun Kumar wrote:
>
> Thank you Andre. Does this mean that if I have any code which is platform 
> dependent, then I should first make it platform-independent and then only I 
> can compile it to wasm? That is, I cannot compile any platform specific 
> code to wasm because emscripten won't have definitions for those?
>
> On Monday, September 3, 2018 at 6:21:46 PM UTC+5:30, Floh wrote:
>>
>> You need the source code for the .dll/.so and compile it to wasm via 
>> emscripten. Yes, wasm files are completely platform independent, but the 
>> source code the wasm is compiled from also must be platform-independent. 
>> Emscripten provides a number of portability wrapper which help a lot, but 
>> if (for instance) the Windows DLL calls Win32 API functions you first need 
>> to take care of those and translate them to APIs that are available on 
>> emscripten.
>>
>> The porting section in the emscripten docs is a good starting point: 
>> https://kripken.github.io/emscripten-site/docs/porting/index.html
>>
>> On Monday, 3 September 2018 14:16:29 UTC+2, Varun Kumar wrote:
>>>
>>> I have a C library(.so). There are two versions of it - one for Windows 
>>> and another for Linux. What would be the right approach to convert it into 
>>> WebAssembly? Also, is the .wasm file completely platform independent?
>>>
>>

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to