I'm making a cross-platform application, and i need my shaders to be compiled to SPIR-V for both Opengl and Vulkan. It seems that the only way to do so is to call a separate program, called "glslangValidator.exe/.deb/.dmg". This sort of makes it cross-platform, but it requires me to change the command that calls the program on each platform (and that's not ideal to me). Can i embed some code or use something else to compile shaders directly from my application?
Typically compiling GLSL to SPIRV would be something you do as part of the build process, so that you end up distributing SPIRV instead of GLSL. Then you don't need to compile it at runtime. Assuming you're using the Vulkan SDK, the binary for glslangValidator (or a shell script to build it) should be part of the installed SDK.
That said, if you want to compile GLSL to SPIRV at runtime, you can link against the glslang library and do that. Take a look at the Programatic Interface section in the readme.