0
Files
src/build/gn_run_binary.py
brettw@chromium.org 137dff6d1b Add yasm to the GN build.
This is forked off of https://codereview.chromium.org/266613002 The code to compile yasm itself is mostly from that patch, with a few updates for the other changes.

Adds a template for running compiled binaries. Compared to Albert's patch above, this assumes the binary is generated by the source tree so can have a cleaner interface (just specify the label of the tool you use).

The yasm rule is new compared to Albert's patch. It uses a special wrapper script instead of the new compiled_action templates so it can properly support depfiles. This also adds convenient support for defines and include dirs.

This adds some trivial ios changes to the content/public/browser. This should be a NOP now.

Fixes a bug in GN depfile creation. Previously, the .d file was emitted as an output of the script, but this confuses ninja. This change just removes that.

BUG=
R=ajwong@chromium.org

Review URL: https://codereview.chromium.org/321323004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276772 0039d316-1c4b-4281-b951-d872f2087c98
2014-06-12 19:35:55 +00:00

23 lines
669 B
Python

# Copyright 2014 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.
"""Helper script for GN to run an arbitrary binary. See compiled_action.gni.
Run with:
python gn_run_binary.py <binary_name> [args ...]
"""
import sys
import subprocess
# This script is designed to run binaries produced by the current build. We
# always prefix it with "./" to avoid picking up system versions that might
# also be on the path.
path = './' + sys.argv[1]
# The rest of the arguements are passed directly to the executable.
args = [path] + sys.argv[2:]
sys.exit(subprocess.call(args))