Make osd a cmake object library.

An object library allows other build targets to use the object files
from this library.

The change introduces osd_static_cpu_obj which is consumed by
osd_static_cpu.

This will be useful for emscripten integration where we cant use the
compiled library, rather it will use the object files, targeting
osd_static_cpu_obj.
Add JAVASCRIPT flag to root CMakeLists.txt

Explicitly disable various dependency lookups when JAVASCRIPT mode is
enabled. This is in preparation for emscripten builds.
Silence needless CMake warnings in JAVASCRIPT mode
Add EMSCRIPTEN_DIR var to drive other params.

When EMSCRIPTEN_DIR is set, also set the JAVASCRIPT flag, the C/C++
compilers to emcc and set various include paths to
$EMSCRIPTEN_DIR/system/include.