Fix SkSL test compilation on Windows.

The command-line length limit on Windows is very low (~8000 characters)
so it's infeasible to pass a large number of test files directly on the
command line. Fortunately, GN includes a built-in workaround.

Change-Id: I087fc00f11d81d84f677c2833406b4a6164ea6b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360716
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
John Stiles 2021-01-27 14:05:15 -05:00
parent 2c3cec998f
commit b7f5e1b20d
2 changed files with 11 additions and 6 deletions

View File

@ -710,10 +710,12 @@ if (skia_compile_sksl_tests) {
]
sources = []
outputs = []
response_file_contents = []
args = [
rebase_path(skslc_path),
invoker.lang,
invoker.settings,
"{{response_file_name}}",
]
testsDir = get_path_info("tests", "abspath")
@ -726,10 +728,10 @@ if (skia_compile_sksl_tests) {
dir = get_path_info(dst, "dir")
name = get_path_info(dst, "name")
ext = get_path_info(dst, "extension")
args += rebase_path([
src,
dir,
])
response_file_contents += rebase_path([
src,
dir,
])
sources += [ src ]
foreach(outExtension, invoker.outExtensions) {

View File

@ -6,15 +6,18 @@
# found in the LICENSE file.
import os
import shlex
import subprocess
import sys
import tempfile
batchCompile = True
skslc = sys.argv[1]
lang = sys.argv[2]
settings = sys.argv[3]
inputs = sys.argv[4:]
batchCompile = True
with open(sys.argv[4], 'r') as reader:
inputs = shlex.split(reader.read())
def pairwise(iterable):
# Iterate over an array pairwise (two elements at a time).