Open ubitux opened 3 years ago
Agreed, I'm back to building shaderc after a long while, and it's a nightmare. There's too many options & dependencies, but well the largest problem is really that the KhronosGroup dependencies is a spider web of dependencies & poor design.
The cause of the complexity is that Shaderc is built in various configurations:
Also, the directory structure of various dependencies have changed over time, and the current setup "works".
You're correct, the support for pkg-config has been spotty and inconsistent.
Changes to improve things would have to ensure at least the following downstream projects do not break in the meantime:
The current build system is unusable for any packager because of the hard ties with its third parties.
The work of the packager is usually to build separate controlled packages for every unit. In the case of shaderc, there will be a package for spirv-headers, a package for spirv-tools, and a package for glslang. All of them will deploy all the necessary libs and headers in the appropriate prefix.
To build shaderc on top of that, I had to hack the build system. Here is a draft:
Of course, this has several caveats as is:
glslang_SOURCE_DIR
andspirv-tools_SOURCE_DIR
to the appropriate include path, and likewise the link library is missing. Usually, you want to usefind_library()
, but given how messy the Khronos dependencies are deployed, this might be a challenge. Of course, there is also the hope that these dependencies end up deploying a.pc
(pkg-config) containing version, link libraries, include paths, etc, which would solve all of this.build-version.inc
, but they are only used for a help print, so I skipped them for nowI don't know how we can proceed from here, but the current state really is terrible.