cmake: Rename glslang to glslangValidator
Rename glslangValidator to glslang and adds a glslangValidator symlink to the build and install directories. Closes #47.
This commit is contained in:
parent
a9a2625416
commit
856e280502
@ -65,7 +65,7 @@ if(NOT ${SKIP_GLSLANG_INSTALL})
|
|||||||
endif()
|
endif()
|
||||||
option(ENABLE_SPVREMAPPER "Enables building of SPVRemapper" ON)
|
option(ENABLE_SPVREMAPPER "Enables building of SPVRemapper" ON)
|
||||||
|
|
||||||
option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON)
|
option(ENABLE_GLSLANG_BINARIES "Builds glslang and spirv-remap" ON)
|
||||||
|
|
||||||
option(ENABLE_GLSLANG_JS
|
option(ENABLE_GLSLANG_JS
|
||||||
"If using Emscripten, build glslang.js. Otherwise, builds a sample executable for binary-size testing." OFF)
|
"If using Emscripten, build glslang.js. Otherwise, builds a sample executable for binary-size testing." OFF)
|
||||||
@ -319,11 +319,11 @@ if(ENABLE_CTEST AND BUILD_TESTING)
|
|||||||
|
|
||||||
if (CMAKE_CONFIGURATION_TYPES)
|
if (CMAKE_CONFIGURATION_TYPES)
|
||||||
set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/localResults)
|
set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/localResults)
|
||||||
set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIG>/glslangValidator)
|
set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIG>/glslang)
|
||||||
set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIG>/spirv-remap)
|
set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIG>/spirv-remap)
|
||||||
else()
|
else()
|
||||||
set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/localResults)
|
set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/localResults)
|
||||||
set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/glslangValidator)
|
set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/glslang)
|
||||||
set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/spirv-remap)
|
set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/spirv-remap)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ BUILD DEPENDENCIES:
|
|||||||
|
|
||||||
BUILDING
|
BUILDING
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
The standalone remapper is built along side glslangValidator through its
|
The standalone remapper is built along side glslang through its
|
||||||
normal build process.
|
normal build process.
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ An API for getting reflection information from the AST, reflection types/variabl
|
|||||||
|
|
||||||
### Standalone Wrapper
|
### Standalone Wrapper
|
||||||
|
|
||||||
`glslangValidator` is command-line tool for accessing the functionality above.
|
`glslang` is command-line tool for accessing the functionality above.
|
||||||
|
|
||||||
Status: Complete.
|
Status: Complete.
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ The above page, while not kept up to date, includes additional information regar
|
|||||||
|
|
||||||
## Execution of Standalone Wrapper
|
## Execution of Standalone Wrapper
|
||||||
|
|
||||||
To use the standalone binary form, execute `glslangValidator`, and it will print
|
To use the standalone binary form, execute `glslang`, and it will print
|
||||||
a usage statement. Basic operation is to give it a file containing a shader,
|
a usage statement. Basic operation is to give it a file containing a shader,
|
||||||
and it will print out warnings/errors and optionally an AST.
|
and it will print out warnings/errors and optionally an AST.
|
||||||
|
|
||||||
|
@ -45,13 +45,12 @@ add_custom_command(
|
|||||||
DEPENDS ${GLSLANG_INTRINSIC_PY}
|
DEPENDS ${GLSLANG_INTRINSIC_PY}
|
||||||
COMMENT "Generating ${GLSLANG_INTRINSIC_H}")
|
COMMENT "Generating ${GLSLANG_INTRINSIC_H}")
|
||||||
|
|
||||||
#add_custom_target(glslangValidator DEPENDS ${GLSLANG_INTRINSIC_H})
|
|
||||||
|
|
||||||
set(SOURCES StandAlone.cpp DirStackFileIncluder.h ${GLSLANG_INTRINSIC_H})
|
set(SOURCES StandAlone.cpp DirStackFileIncluder.h ${GLSLANG_INTRINSIC_H})
|
||||||
|
|
||||||
add_executable(glslangValidator ${SOURCES})
|
add_executable(glslang-standalone ${SOURCES})
|
||||||
set_property(TARGET glslangValidator PROPERTY FOLDER tools)
|
set_property(TARGET glslang-standalone PROPERTY FOLDER tools)
|
||||||
glslang_set_link_args(glslangValidator)
|
set_property(TARGET glslang-standalone PROPERTY OUTPUT_NAME glslang)
|
||||||
|
glslang_set_link_args(glslang-standalone)
|
||||||
|
|
||||||
set(LIBRARIES
|
set(LIBRARIES
|
||||||
glslang
|
glslang
|
||||||
@ -70,13 +69,13 @@ elseif(UNIX)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(glslangValidator ${LIBRARIES})
|
target_link_libraries(glslang-standalone ${LIBRARIES})
|
||||||
target_include_directories(glslangValidator PUBLIC
|
target_include_directories(glslang-standalone PUBLIC
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
|
||||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
|
||||||
|
|
||||||
if(ENABLE_OPT)
|
if(ENABLE_OPT)
|
||||||
target_include_directories(glslangValidator
|
target_include_directories(glslang-standalone
|
||||||
PRIVATE ${spirv-tools_SOURCE_DIR}/include
|
PRIVATE ${spirv-tools_SOURCE_DIR}/include
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
@ -94,19 +93,31 @@ if(WIN32)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_GLSLANG_INSTALL)
|
if(ENABLE_GLSLANG_INSTALL)
|
||||||
install(TARGETS glslangValidator EXPORT glslang-targets)
|
install(TARGETS glslang-standalone EXPORT glslang-targets)
|
||||||
|
|
||||||
# Backward compatibility
|
# Backward compatibility
|
||||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/glslangValidatorTargets.cmake" "
|
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/glslang-standaloneTargets.cmake" "
|
||||||
message(WARNING \"Using `glslangValidatorTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
|
message(WARNING \"Using `glslang-standaloneTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
|
||||||
|
|
||||||
if (NOT TARGET glslang::glslangValidator)
|
if (NOT TARGET glslang::glslang-standalone)
|
||||||
include(\"${CMAKE_INSTALL_FULL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
|
include(\"${CMAKE_INSTALL_FULL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(glslangValidator ALIAS glslang::glslangValidator)
|
add_library(glslang-standalone ALIAS glslang::glslang-standalone)
|
||||||
")
|
")
|
||||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glslangValidatorTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glslang-standaloneTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
|
||||||
|
|
||||||
|
# Create a symbolic link to glslang named glslangValidator for backwards compatibility
|
||||||
|
set(legacy_glslang_name "glslangValidator${CMAKE_EXECUTABLE_SUFFIX}")
|
||||||
|
add_custom_command(TARGET glslang-standalone
|
||||||
|
POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:glslang-standalone> ${legacy_glslang_name}
|
||||||
|
WORKING_DIRECTORY $<TARGET_FILE_DIR:glslang-standalone>)
|
||||||
|
|
||||||
|
# Create the same symlink at install time
|
||||||
|
install(CODE "execute_process( \
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:glslang-standalone> ${legacy_glslang_name} \
|
||||||
|
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR})")
|
||||||
|
|
||||||
if(ENABLE_SPVREMAPPER)
|
if(ENABLE_SPVREMAPPER)
|
||||||
install(TARGETS spirv-remap EXPORT glslang-targets)
|
install(TARGETS spirv-remap EXPORT glslang-targets)
|
||||||
|
@ -1884,7 +1884,7 @@ void CompileFile(const char* fileName, ShHandle compiler)
|
|||||||
//
|
//
|
||||||
void usage()
|
void usage()
|
||||||
{
|
{
|
||||||
printf("Usage: glslangValidator [option]... [file]...\n"
|
printf("Usage: glslang [option]... [file]...\n"
|
||||||
"\n"
|
"\n"
|
||||||
"'file' can end in .<stage> for auto-stage classification, where <stage> is:\n"
|
"'file' can end in .<stage> for auto-stage classification, where <stage> is:\n"
|
||||||
" .conf to provide a config file that replaces the default configuration\n"
|
" .conf to provide a config file that replaces the default configuration\n"
|
||||||
@ -2089,8 +2089,7 @@ void usage()
|
|||||||
" --variable-name <name>\n"
|
" --variable-name <name>\n"
|
||||||
" --vn <name> creates a C header file that contains a\n"
|
" --vn <name> creates a C header file that contains a\n"
|
||||||
" uint32_t array named <name>\n"
|
" uint32_t array named <name>\n"
|
||||||
" initialized with the shader binary code\n"
|
" initialized with the shader binary code\n");
|
||||||
);
|
|
||||||
|
|
||||||
exit(EFailUsage);
|
exit(EFailUsage);
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
399360 ../build/install/bin/glslangValidator.exe
|
399360 ../build/install/bin/glslang.exe
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
glslangValidator.exe --glsl-version 430 -V -S geom -o glsl.versionOverride.geom.out glsl.versionOverride.geom
|
glslang.exe --glsl-version 430 -V -S geom -o glsl.versionOverride.geom.out glsl.versionOverride.geom
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
glslangValidator.exe --glsl-version 440 -V -S tesc -o glsl.versionOverride.tesc.out glsl.versionOverride.tesc
|
glslang.exe --glsl-version 440 -V -S tesc -o glsl.versionOverride.tesc.out glsl.versionOverride.tesc
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
glslangValidator.exe --glsl-version 450 -V -S tese -o glsl.versionOverride.tese.out glsl.versionOverride.tese
|
glslang.exe --glsl-version 450 -V -S tese -o glsl.versionOverride.tese.out glsl.versionOverride.tese
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
../build/install/bin/glslangValidator $*
|
../build/install/bin/glslang $*
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
./glslangValidator -p > instDesc
|
./glslang -p > instDesc
|
||||||
asciidoc --backend=html5 instDesc
|
asciidoc --backend=html5 instDesc
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# 1- TargetDirectory, where to write test results and intermediary files
|
# 1- TargetDirectory, where to write test results and intermediary files
|
||||||
# 2- Path to glslangValidator
|
# 2- Path to glslang
|
||||||
# 3- Path to spirv-remap
|
# 3- Path to spirv-remap
|
||||||
|
|
||||||
TARGETDIR=${1:-localResults}
|
TARGETDIR=${1:-localResults}
|
||||||
BASEDIR=baseResults
|
BASEDIR=baseResults
|
||||||
EXE=${2:-../build/install/bin/glslangValidator}
|
EXE=${2:-../build/install/bin/glslang}
|
||||||
REMAPEXE=${3:-../build/install/bin/spirv-remap}
|
REMAPEXE=${3:-../build/install/bin/spirv-remap}
|
||||||
HASERROR=0
|
HASERROR=0
|
||||||
mkdir -p $TARGETDIR
|
mkdir -p $TARGETDIR
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# It is not meant to preclude the possible addition of the validator to
|
# It is not meant to preclude the possible addition of the validator to
|
||||||
# glslang.
|
# glslang.
|
||||||
|
|
||||||
declare -r EXE='../build/install/bin/glslangValidator'
|
declare -r EXE='../build/install/bin/glslang'
|
||||||
|
|
||||||
# search common locations for spirv-tools: keep first one
|
# search common locations for spirv-tools: keep first one
|
||||||
for toolsdir in '../External/spirv-tools/build/tools' '../../SPIRV-Tools/build/tools/bin' '/usr/local/bin'; do
|
for toolsdir in '../External/spirv-tools/build/tools' '../../SPIRV-Tools/build/tools/bin' '/usr/local/bin'; do
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
TESTLIST=web.testlist
|
TESTLIST=web.testlist
|
||||||
TARGETDIR=localResults
|
TARGETDIR=localResults
|
||||||
BASEDIR=baseResults
|
BASEDIR=baseResults
|
||||||
EXE=../build/install/bin/glslangValidator.exe
|
EXE=../build/install/bin/glslang.exe
|
||||||
HASERROR=0
|
HASERROR=0
|
||||||
mkdir -p $TARGETDIR
|
mkdir -p $TARGETDIR
|
||||||
|
|
||||||
|
@ -471,7 +471,7 @@ public:
|
|||||||
targetLanguageVersion, false, EShTexSampTransKeep, enableOptimizer, enableDebug,
|
targetLanguageVersion, false, EShTexSampTransKeep, enableOptimizer, enableDebug,
|
||||||
enableNonSemanticShaderDebugInfo, automap);
|
enableNonSemanticShaderDebugInfo, automap);
|
||||||
|
|
||||||
// Generate the hybrid output in the way of glslangValidator.
|
// Generate the hybrid output in the way of glslang.
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
outputResultToStream(&stream, result, controls);
|
outputResultToStream(&stream, result, controls);
|
||||||
|
|
||||||
@ -501,7 +501,7 @@ public:
|
|||||||
GlslangResult result = compileAndLink(testName, input, entryPointName, controls, clientTargetVersion,
|
GlslangResult result = compileAndLink(testName, input, entryPointName, controls, clientTargetVersion,
|
||||||
targetLanguageVersion, false, EShTexSampTransKeep, false, automap);
|
targetLanguageVersion, false, EShTexSampTransKeep, false, automap);
|
||||||
|
|
||||||
// Generate the hybrid output in the way of glslangValidator.
|
// Generate the hybrid output in the way of glslang.
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
outputResultToStream(&stream, result, controls);
|
outputResultToStream(&stream, result, controls);
|
||||||
|
|
||||||
@ -527,7 +527,7 @@ public:
|
|||||||
GlslangResult result = compileAndLink(testName, input, entryPointName, controls,
|
GlslangResult result = compileAndLink(testName, input, entryPointName, controls,
|
||||||
glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0, true);
|
glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0, true);
|
||||||
|
|
||||||
// Generate the hybrid output in the way of glslangValidator.
|
// Generate the hybrid output in the way of glslang.
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
outputResultToStream(&stream, result, controls);
|
outputResultToStream(&stream, result, controls);
|
||||||
|
|
||||||
@ -564,7 +564,7 @@ public:
|
|||||||
autoMapBindings,
|
autoMapBindings,
|
||||||
flattenUniformArrays);
|
flattenUniformArrays);
|
||||||
|
|
||||||
// Generate the hybrid output in the way of glslangValidator.
|
// Generate the hybrid output in the way of glslang.
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
outputResultToStream(&stream, result, controls);
|
outputResultToStream(&stream, result, controls);
|
||||||
|
|
||||||
@ -591,7 +591,7 @@ public:
|
|||||||
const EShMessages controls = DeriveOptions(source, semantics, target);
|
const EShMessages controls = DeriveOptions(source, semantics, target);
|
||||||
GlslangResult result = compileLinkRemap(testName, input, entryPointName, controls, remapOptions);
|
GlslangResult result = compileLinkRemap(testName, input, entryPointName, controls, remapOptions);
|
||||||
|
|
||||||
// Generate the hybrid output in the way of glslangValidator.
|
// Generate the hybrid output in the way of glslang.
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
outputResultToStream(&stream, result, controls);
|
outputResultToStream(&stream, result, controls);
|
||||||
|
|
||||||
@ -618,7 +618,7 @@ public:
|
|||||||
const EShMessages controls = DeriveOptions(source, semantics, target);
|
const EShMessages controls = DeriveOptions(source, semantics, target);
|
||||||
GlslangResult result = remap(testName, input, controls, remapOptions);
|
GlslangResult result = remap(testName, input, controls, remapOptions);
|
||||||
|
|
||||||
// Generate the hybrid output in the way of glslangValidator.
|
// Generate the hybrid output in the way of glslang.
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
outputResultToStream(&stream, result, controls);
|
outputResultToStream(&stream, result, controls);
|
||||||
|
|
||||||
@ -698,7 +698,7 @@ public:
|
|||||||
glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0, false,
|
glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0, false,
|
||||||
EShTexSampTransUpgradeTextureRemoveSampler);
|
EShTexSampTransUpgradeTextureRemoveSampler);
|
||||||
|
|
||||||
// Generate the hybrid output in the way of glslangValidator.
|
// Generate the hybrid output in the way of glslang.
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
outputResultToStream(&stream, result, controls);
|
outputResultToStream(&stream, result, controls);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user