Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Unified Diff: fusl/tools/copy_crt.py

Issue 1628443003: Use GN to copy crt objects into fusl sysroot (Closed) Base URL: https://github.com/domokit/mojo.git@gn-update
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fusl/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fusl/tools/copy_crt.py
diff --git a/fusl/tools/copy_crt.py b/fusl/tools/copy_crt.py
deleted file mode 100755
index 50414650b845065b87ed5f3538d03fbed91ebb02..0000000000000000000000000000000000000000
--- a/fusl/tools/copy_crt.py
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2016 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""A tool to populate the C runtime portions of a fusl sysroot. This
-script primarily exists because it is easier to copy manually than to
-teach GN how to treat .o files as first class outputs."""
-
-import argparse
-import os
-import shutil
-import sys
-
-def copy_sysroot(args, files):
- try:
- os.makedirs(args.target)
- except OSError:
- # It already exists. Probably.
- pass
-
- for file in files:
- source_file = os.path.join(args.source, file)
-
- # Some source files will be under a subdirectory, so take the last
- # path component.
- _, stripped_file = os.path.split(source_file)
- # Strip out the prefix gn places for its object files.
- assert(stripped_file.startswith(args.gn_prefix))
- stripped_file = stripped_file[len(args.gn_prefix):]
- target_file = os.path.join(args.target, stripped_file)
-
- shutil.copyfile(source_file, target_file)
-
-
-def parse():
- parser = argparse.ArgumentParser()
-
- parser.add_argument('--source',
- required=True,
- help='Source directory')
- parser.add_argument('--target',
- required=True,
- help='Target directory')
- parser.add_argument('--gn-prefix',
- required=True,
- help='File prefix added by GN')
-
- return parser.parse_known_args()
-
-
-def main():
- args, files = parse()
- copy_sysroot(args, files)
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(main())
« no previous file with comments | « fusl/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698