You mean, you’d like to compile a C++ project into WebAssembly without using Emscripten compiler? I would actually be curious to learn how does one do that.
I have an example project for the “opposite” case - that is with using Emscripten compiler - but looks like it won’t be of interest for you then.
It looks like a toolchain file would be needed. There, you can set the executable extension to .wasm (as it is linker output that is WASM-loadable, not the .o file). You can probably start from an Emscripten toolchain and adapt it as needed.