skia2/gn/compile_processors.py
Ethan Nicholas b9f6afb783 switched to infra version of clang-format for skslc
Change-Id: I3e993e271cb5e26816d37c70d9ad62acce3ed84c
Reviewed-on: https://skia-review.googlesource.com/27800
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-07-27 20:28:50 +00:00

29 lines
897 B
Python
Executable File

#!/usr/bin/env python
#
# Copyright 2017 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
skslc = sys.argv[1]
clangFormat = sys.argv[2]
processors = sys.argv[3:]
for p in processors:
path, _ = os.path.splitext(p)
print("Recompiling " + p + "...")
try:
subprocess.check_output([skslc, p, path + ".h"])
subprocess.check_call(clangFormat + " --sort-includes=false -i \"" +
path + ".h\"", shell=True)
subprocess.check_output([skslc, p, path + ".cpp"])
subprocess.check_call(clangFormat + " --sort-includes=false -i \"" +
path + ".cpp\"", shell=True)
except subprocess.CalledProcessError as err:
print("### Error compiling " + p + ":")
print(err.output)
exit(1)