3 ms·
IMHO most problems (apart from the missing C APIs) of the Android NDK could be fixed if they'd steal a few ideas from the emscripten SDK. In emscripten I can d
by flohofwoe 6y ago
IMHO most problems (apart from the missing C APIs) of the Android NDK could be fixed if they'd steal a few ideas from the emscripten SDK.
In emscripten I can do:
emcc hello.c -o hello.html
...and this gives me a complete 'web application' ready to run in the browser.
With the Android NDK I should be able to do this:
ndkcc hello.c -o hello.apk
...and this should give me a complete APK ready to run on the device. Emscripten's emcc is just a "simple" python wrapper script which looks like a gcc-compatible compiler/linker from the outside, but does additional things besides calling the C/C++ compiler and linker (such as creating a .js and .html file next to the .wasm compiler output).
If the NDK would have such a compiler wrapper script it would be absolutely trivial to integrate with any existing C/C++ build system.
Another idea the Android NDK should steal from Emscripten is how to integrate the C/C++ side with the "other" side (in Emscripten's case Javascript, and in the NDK's case Java). In Emscripten I can simply embed Javascript code into the C source files with some macro-magic, and call back and forth directly between C and JS. This is how the Java integration should work in the NDK. I shouldn't have to deal with the JNI or with the Java toolchain or with .java files at all.