move ResourceLimits from StandAlone to glslang dir (Fix #3064)

This commit is contained in:
Moritz Heinemann 2023-02-15 20:06:26 +01:00
parent 6d41bb9c55
commit f5fa593143
6 changed files with 40 additions and 29 deletions

View File

@ -209,7 +209,7 @@ cc_library(
cc_library( cc_library(
name = "glslang-default-resource-limits", name = "glslang-default-resource-limits",
srcs = ["StandAlone/ResourceLimits.cpp"], srcs = ["glslang/ResourceLimits/ResourceLimits.cpp"],
hdrs = ["glslang/Public/ResourceLimits.h"], hdrs = ["glslang/Public/ResourceLimits.h"],
copts = COMMON_COPTS, copts = COMMON_COPTS,
linkstatic = 1, linkstatic = 1,

View File

@ -299,7 +299,7 @@ glslang_sources_common("glslang_sources") {
source_set("glslang_default_resource_limits_sources") { source_set("glslang_default_resource_limits_sources") {
sources = [ sources = [
"StandAlone/ResourceLimits.cpp", "glslang/ResourceLimits/ResourceLimits.cpp",
"glslang/Public/ResourceLimits.h", "glslang/Public/ResourceLimits.h",
"glslang/Include/ResourceLimits.h", "glslang/Include/ResourceLimits.h",
] ]

View File

@ -47,17 +47,6 @@ add_custom_command(
#add_custom_target(glslangValidator DEPENDS ${GLSLANG_INTRINSIC_H}) #add_custom_target(glslangValidator DEPENDS ${GLSLANG_INTRINSIC_H})
add_library(glslang-default-resource-limits
${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp
${CMAKE_CURRENT_SOURCE_DIR}/resource_limits_c.cpp)
set_target_properties(glslang-default-resource-limits PROPERTIES VERSION "${GLSLANG_VERSION}" SOVERSION "${GLSLANG_VERSION_MAJOR}")
set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang)
set_property(TARGET glslang-default-resource-limits PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(glslang-default-resource-limits
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>)
set(SOURCES StandAlone.cpp DirStackFileIncluder.h ${GLSLANG_INTRINSIC_H}) set(SOURCES StandAlone.cpp DirStackFileIncluder.h ${GLSLANG_INTRINSIC_H})
add_executable(glslangValidator ${SOURCES}) add_executable(glslangValidator ${SOURCES})
@ -135,18 +124,4 @@ if(ENABLE_GLSLANG_INSTALL)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/spirv-remapTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/spirv-remapTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
endif() endif()
install(TARGETS glslang-default-resource-limits EXPORT glslang-targets)
# Backward compatibility
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/glslang-default-resource-limitsTargets.cmake" "
message(WARNING \"Using `glslang-default-resource-limitsTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::glslang-default-resource-limits)
include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
endif()
add_library(glslang-default-resource-limits ALIAS glslang::glslang-default-resource-limits)
")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glslang-default-resource-limitsTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
endif() endif()

View File

@ -149,8 +149,6 @@ set(GLSLANG_SOURCES
set(GLSLANG_HEADERS set(GLSLANG_HEADERS
Public/ShaderLang.h Public/ShaderLang.h
Public/ResourceLimits.h
Public/resource_limits_c.h
Include/arrays.h Include/arrays.h
Include/BaseTypes.h Include/BaseTypes.h
Include/Common.h Include/Common.h
@ -185,6 +183,30 @@ if(WIN32 AND BUILD_SHARED_LIBS)
set_target_properties(glslang PROPERTIES PREFIX "") set_target_properties(glslang PROPERTIES PREFIX "")
endif() endif()
################################################################################
# ResourceLimits
################################################################################
set(RESOURCELIMITS_SOURCES
ResourceLimits/ResourceLimits.cpp
ResourceLimits/resource_limits_c.cpp
)
set(RESOURCELIMITS_HEADERS
Public/ResourceLimits.h
Public/resource_limits_c.h
)
add_library(glslang-default-resource-limits ${RESOURCELIMITS_SOURCES} ${RESOURCELIMITS_HEADERS})
set_target_properties(glslang-default-resource-limits PROPERTIES
VERSION "${GLSLANG_VERSION}"
SOVERSION "${GLSLANG_VERSION_MAJOR}"
FOLDER glslang
POSITION_INDEPENDENT_CODE ON)
target_include_directories(glslang-default-resource-limits PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
################################################################################ ################################################################################
# source_groups # source_groups
################################################################################ ################################################################################
@ -237,4 +259,18 @@ if(ENABLE_GLSLANG_INSTALL)
install(FILES ${GLSLANG_BUILD_INFO_H} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang) install(FILES ${GLSLANG_BUILD_INFO_H} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang)
install(TARGETS glslang-default-resource-limits EXPORT glslang-targets)
# Backward compatibility
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/glslang-default-resource-limitsTargets.cmake" "
message(WARNING \"Using `glslang-default-resource-limitsTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::glslang-default-resource-limits)
include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
endif()
add_library(glslang-default-resource-limits ALIAS glslang::glslang-default-resource-limits)
")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glslang-default-resource-limitsTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
endif() endif()