mirror of
https://github.com/chromium/crashpad.git
synced 2025-01-14 09:17:57 +08:00
Update mig.py to take an explicit sdk argument.
BUG=chromium:690734 > Review-Url: https://codereview.chromium.org/2685233002 > Cr-Commit-Position: refs/heads/master@{#449550} > Message-Id: Merged from chromium 53f2146935506b4f382705b605dffec41b5519eb Change-Id: I1b3176a4a62078f1e27184ad589c9c3f4b548674 Reviewed-on: https://chromium-review.googlesource.com/440847 Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
1f82c6cc8a
commit
c1b305244a
@ -15,6 +15,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
@ -107,23 +108,32 @@ extern "C" {
|
||||
file.close()
|
||||
|
||||
def main(args):
|
||||
if len(args) == 5:
|
||||
(defs_file, user_c, server_c, user_h, server_h) = args
|
||||
elif len(args) == 6:
|
||||
(defs_file, user_c, server_c, user_h, server_h, dev_dir) = args
|
||||
os.environ['DEVELOPER_DIR'] = dev_dir
|
||||
else:
|
||||
assert False, "Wrong number of arguments"
|
||||
subprocess.check_call(['mig',
|
||||
'-user', user_c,
|
||||
'-server', server_c,
|
||||
'-header', user_h,
|
||||
'-sheader', server_h,
|
||||
defs_file])
|
||||
FixUserImplementation(user_c)
|
||||
server_declarations = FixServerImplementation(server_c)
|
||||
FixHeader(user_h)
|
||||
FixHeader(server_h, server_declarations)
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--developer-dir', help='Path to Xcode')
|
||||
parser.add_argument('--sdk', help='Path to SDK')
|
||||
parser.add_argument('defs')
|
||||
parser.add_argument('user_c')
|
||||
parser.add_argument('server_c')
|
||||
parser.add_argument('user_h')
|
||||
parser.add_argument('server_h')
|
||||
parsed = parser.parse_args(args)
|
||||
|
||||
command = ['mig',
|
||||
'-user', parsed.user_c,
|
||||
'-server', parsed.server_c,
|
||||
'-header', parsed.user_h,
|
||||
'-sheader', parsed.server_h,
|
||||
]
|
||||
if parsed.sdk is not None:
|
||||
command.extend(['-isysroot', parsed.sdk])
|
||||
if parsed.developer_dir is not None:
|
||||
os.environ['DEVELOPER_DIR'] = parsed.developer_dir
|
||||
command.append(parsed.defs)
|
||||
subprocess.check_call(command)
|
||||
FixUserImplementation(parsed.user_c)
|
||||
server_declarations = FixServerImplementation(parsed.server_c)
|
||||
FixHeader(parsed.user_h)
|
||||
FixHeader(parsed.server_h, server_declarations)
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main(sys.argv[1:]))
|
||||
|
Loading…
x
Reference in New Issue
Block a user