0
Files
src/build/inverse_depth.py
darin@chromium.org a4b0f408ac Mojo: Include "path/to/foo.mojom.h"
Given path/to/foo.mojom, change the code generator to output:

  <(SHARED_INTERMEDIATE_DIR)/path/to/foo.mojom.cc
  <(SHARED_INTERMEDIATE_DIR)/path/to/foo.mojom.h
  <(SHARED_INTERMEDIATE_DIR)/path/to/foo.mojom-internal.h

This involves shelling out to a python script to compute "path/to" part as that is not otherwise available from GYP. See build/inverse_depth.py.

DEPTH is now passed to mojom_bindings_generator.py so that it can similarly compute "path/to". With that, we no longer need the include_dir argument, so I dropped it.

R=davemoore@chromium.org, mark@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253937 0039d316-1c4b-4281-b951-d872f2087c98
2014-02-27 22:07:43 +00:00

25 lines
491 B
Python
Executable File

#!/usr/bin/env 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.
import os
import sys
def DoMain(argv):
depth = argv[0]
return os.path.relpath(os.getcwd(), os.path.abspath(depth))
def main(argv):
if len(argv) < 2:
print "USAGE: inverse_depth.py depth"
return 1
print DoMain(argv[1:])
return 0
if __name__ == '__main__':
sys.exit(main(sys.argv))