Add aliases for the public libraries

This makes things consistent between when glslang is installed and imported versus when it's included as nested CMake project.
You can now use `glslang::glslang` in both cases instead of needing the non-namespaced version sometimes and the namespaced one other times.

Resolves one of the problems discussed in https://github.com/KhronosGroup/glslang/issues/3509
This commit is contained in:
AnyOldName3 2024-02-14 16:38:44 +00:00 committed by arcady-lunarg
parent 02263efcd6
commit a92c61f845
2 changed files with 4 additions and 0 deletions

View File

@ -79,6 +79,7 @@ set(PUBLIC_HEADERS
SPVRemapper.h)
add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS})
add_library(glslang::SPIRV ALIAS SPIRV)
set_target_properties(SPIRV PROPERTIES
FOLDER glslang
POSITION_INDEPENDENT_CODE ON
@ -92,6 +93,7 @@ glslang_add_build_info_dependency(SPIRV)
if (ENABLE_SPVREMAPPER)
add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS})
add_library(glslang::SPVRemapper ALIAS SPVRemapper)
set_target_properties(SPVRemapper PROPERTIES
FOLDER glslang
POSITION_INDEPENDENT_CODE ON

View File

@ -169,6 +169,7 @@ set(GLSLANG_HEADERS
Include/Types.h)
add_library(glslang ${LIB_TYPE} ${GLSLANG_SOURCES} ${GLSLANG_HEADERS})
add_library(glslang::glslang ALIAS glslang)
set_target_properties(glslang PROPERTIES
FOLDER glslang
POSITION_INDEPENDENT_CODE ON
@ -201,6 +202,7 @@ set(RESOURCELIMITS_HEADERS
)
add_library(glslang-default-resource-limits ${RESOURCELIMITS_SOURCES} ${RESOURCELIMITS_HEADERS})
add_library(glslang::glslang-default-resource-limits ALIAS glslang-default-resource-limits)
set_target_properties(glslang-default-resource-limits PROPERTIES
VERSION "${GLSLANG_VERSION}"
SOVERSION "${GLSLANG_VERSION_MAJOR}"