blob: 9fc5c3de596cead5608a004194d978622c1d87c5 [file] [log] [blame]
Ethan Nicholas762466e2017-06-29 10:03:38 -04001#!/usr/bin/env python
2#
3# Copyright 2017 Google Inc.
4#
5# Use of this source code is governed by a BSD-style license that can be
6# found in the LICENSE file.
7
8import os
9import subprocess
10import sys
11
12skslc = sys.argv[1]
13processors = sys.argv[2:]
14for p in processors:
15 path, _ = os.path.splitext(p)
Ethan Nicholas9fb036f2017-07-05 16:19:09 -040016 print("Recompiling " + p + "...")
17 try:
18 subprocess.check_output([skslc, p, path + ".h"])
Ethan Nicholasb7e8c3b2017-07-19 13:54:20 -040019 subprocess.check_call("clang-format --sort-includes=false -i \"" +
20 path + ".h\"", shell=True)
Ethan Nicholas9fb036f2017-07-05 16:19:09 -040021 subprocess.check_output([skslc, p, path + ".cpp"])
Ethan Nicholasb7e8c3b2017-07-19 13:54:20 -040022 subprocess.check_call("clang-format --sort-includes=false -i \"" +
23 path + ".cpp\"", shell=True)
Ethan Nicholas9fb036f2017-07-05 16:19:09 -040024 except subprocess.CalledProcessError as err:
25 print("### Error compiling " + p + ":")
26 print(err.output)
27 exit(1)