KhronosGroup / glslang

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Other
2.9k stars 816 forks source link

cmake: allow enabling of tests and install independently of whether the project is top level #3507

Closed dneto0 closed 4 months ago

dneto0 commented 4 months ago

Glslang tests and installs only if Glslang is the top-level project directory. See https://github.com/KhronosGroup/glslang/blob/47a02a987c4e6dc573dfca1b80e5e3eacf4e2ed8/CMakeLists.txt#L307

This makes the project non-composable. It's also a regression from before where enclosing projects like Shaderc want to test Glslang's tests.

Ultimately, the disabling of tests caused us to miss the following problem https://github.com/KhronosGroup/glslang/issues/3505

(It seems to me it's an anti-pattern to overuse PROJECT_IS_TOP_LEVEL?)

cc: @juan-lunarg @arcady-lunarg

AnyOldName3 commented 4 months ago

Looks like you posted this while I was writing up https://github.com/KhronosGroup/glslang/issues/3509, which covers this and a couple of other, smaller problems.