
First call YOUR emsdk_env.bat

D:\emsdk-main\emsdk_env.bat


Then at the root dir execute


call emcc -DMOCKFILES -Wno-multichar "lib.c" -o "Web\cake.js" -s WASM=0 -s EXPORTED_FUNCTIONS="['_CompileText']" -s EXTRA_EXPORTED_RUNTIME_METHODS="['ccall', 'cwrap']"


This will generate Web\cake.js




This can be used in html to open the sample in playground


//Button Try after the sample 
<button onclick="Try(this)">try</button>

<script>
    function Try(elm)
    {
        //collect the text previous sample
        var source = elm.previousElementSibling.innerText;

        var link = "http://thradams.com/cake/playground.html?code=" + encodeURIComponent(btoa(source)) +
            "&to=" + encodeURI("1") +
            "&options=" + encodeURI("");

        window.open(link);
    }

</script>
