Skip to content

Commit 93d91bd

Browse files
committed
build, install, and script improvements
1 parent 0953dda commit 93d91bd

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

samples/spirv/01_spirvprobe/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ add_opencl_sample(
2121
VERSION 300
2222
CATEGORY spirv
2323
SOURCES main.cpp ${CMAKE_CURRENT_BINARY_DIR}/spirv_probes_generated.def
24-
INCLUDES ${SPIRV-Headers_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}
24+
KERNELS check_spirv.sh
25+
INCLUDES ${SPIRV-Headers_SOURCE_DIR}/include ${SPIRV_TOOLS_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}
2526
LIBS ${SPIRV_TOOLS_LDFLAGS})

samples/spirv/01_spirvprobe/check_spirv.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -u
33

44
dir="spirv_dumps"
55
tool="./spirvkernelfromfile"
6-
options="-p1"
6+
options="${options:-}"
77

88
if [[ ! -d "$dir" ]]; then
99
echo "Error: directory not found: $dir"
@@ -26,8 +26,13 @@ fi
2626
for file in "${files[@]}"; do
2727
name="$(basename "$file")"
2828

29-
printf 'Running: %q %q --file=%q\n' "$tool" "$options" "$file"
30-
"$tool" "$options" --file="$file" > NUL 2>&1
29+
if [[ -z "$options" ]]; then
30+
printf 'Running: %q --file=%q\n' "$tool" "$file"
31+
"$tool" --file="$file" > /dev/null 2>&1
32+
else
33+
printf 'Running: %q %q --file=%q\n' "$tool" "$options" "$file"
34+
"$tool" "$options" --file="$file" > /dev/null 2>&1
35+
fi
3136
rc=$?
3237

3338
if (( rc == 0 )); then

0 commit comments

Comments
 (0)