@@ -132,7 +132,14 @@ main() {
132
132
done
133
133
134
134
# Find all benchmark files in package directories:
135
- js_bench_files=$( find " ${directories} " -maxdepth 3 -wholename ' **/benchmark/benchmark*.js' | grep -v ' /fixtures/' | sort -u | tr ' \n' ' ' ) || true
135
+ js_bench_files=" "
136
+ for dir in ${directories} ; do
137
+ if [ -d " ${dir} " ]; then
138
+ files=$( find " ${dir} " -maxdepth 3 -wholename ' **/benchmark/benchmark*.js' | grep -v ' /fixtures/' | sort -u | tr ' \n' ' ' ) || true
139
+ js_bench_files=" ${js_bench_files} ${files} "
140
+ fi
141
+ done
142
+ js_bench_files=$( echo " ${js_bench_files} " | xargs)
136
143
137
144
# Run JS benchmarks:
138
145
if [ -n " ${js_bench_files} " ]; then
@@ -143,10 +150,25 @@ main() {
143
150
144
151
# Run C benchmarks:
145
152
echo " Finding C benchmark files in ${directories} ..."
146
- c_bench_files=$( find " ${directories} " -maxdepth 5 \( -wholename ' **/benchmark/c/benchmark*.c' -or -wholename ' **/benchmark/c/**/benchmark*.c' \) -exec realpath {} \; | grep -v ' /fixtures/' | sort -u | tr ' \n' ' ' ) || true
153
+ c_bench_files=" "
154
+ for dir in ${directories} ; do
155
+ if [ -d " ${dir} " ]; then
156
+ files=$( find " ${dir} " -maxdepth 5 \( -wholename ' **/benchmark/c/benchmark*.c' -or -wholename ' **/benchmark/c/**/benchmark*.c' \) -exec realpath {} \; | grep -v ' /fixtures/' | sort -u | tr ' \n' ' ' ) || true
157
+ c_bench_files=" ${c_bench_files} ${files} "
158
+ fi
159
+ done
160
+ c_bench_files=$( echo " ${c_bench_files} " | xargs)
147
161
148
162
# If benchmarks requiring Cephes are found, install the Cephes library:
149
- c_cephes_makefiles=$( find " ${directories} " -maxdepth 5 -wholename ' **/benchmark/c/**/Makefile' -exec grep -l ' CEPHES' {} + || true)
163
+ c_cephes_makefiles=" "
164
+ for dir in ${directories} ; do
165
+ if [ -d " ${dir} " ]; then
166
+ files=$( find " ${dir} " -maxdepth 5 -wholename ' **/benchmark/c/**/Makefile' -exec grep -l ' CEPHES' {} + || true)
167
+ c_cephes_makefiles=" ${c_cephes_makefiles} ${files} "
168
+ fi
169
+ done
170
+ c_cephes_makefiles=$( echo " ${c_cephes_makefiles} " | xargs)
171
+
150
172
if [ -n " ${c_cephes_makefiles} " ]; then
151
173
make install-deps-cephes
152
174
fi
0 commit comments