media/webrtc/trunk/build/json_schema_compile.gypi

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/media/webrtc/trunk/build/json_schema_compile.gypi	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,110 @@
     1.4 +# Copyright (c) 2012 The Chromium Authors. All rights reserved.
     1.5 +# Use of this source code is governed by a BSD-style license that can be
     1.6 +# found in the LICENSE file.
     1.7 +
     1.8 +{
     1.9 +  'variables': {
    1.10 +    # When including this gypi, the following variables must be set:
    1.11 +    #   json_schema_files: a list of json files that comprise the api model.
    1.12 +    #   idl_schema_files: a list of IDL files that comprise the api model.
    1.13 +    #   cc_dir: path to generated files
    1.14 +    #   root_namespace: the C++ namespace that all generated files go under
    1.15 +    # Functions and namespaces can be excluded by setting "nocompile" to true.
    1.16 +    'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler',
    1.17 +    'api_gen': '<(api_gen_dir)/compiler.py',
    1.18 +  },
    1.19 +  'rules': [
    1.20 +    {
    1.21 +      'rule_name': 'genapi',
    1.22 +      'extension': 'json',
    1.23 +      'inputs': [
    1.24 +        '<(api_gen_dir)/any.cc',
    1.25 +        '<(api_gen_dir)/any.h',
    1.26 +        '<(api_gen_dir)/any_helper.py',
    1.27 +        '<(api_gen_dir)/cc_generator.py',
    1.28 +        '<(api_gen_dir)/code.py',
    1.29 +        '<(api_gen_dir)/compiler.py',
    1.30 +        '<(api_gen_dir)/cpp_type_generator.py',
    1.31 +        '<(api_gen_dir)/cpp_util.py',
    1.32 +        '<(api_gen_dir)/h_generator.py',
    1.33 +        '<(api_gen_dir)/json_schema.py',
    1.34 +        '<(api_gen_dir)/model.py',
    1.35 +        '<(api_gen_dir)/util.cc',
    1.36 +        '<(api_gen_dir)/util.h',
    1.37 +        '<(api_gen_dir)/util_cc_helper.py',
    1.38 +        # TODO(calamity): uncomment this when gyp on windows behaves like other
    1.39 +        # platforms. List expansions of filepaths in inputs expand to different
    1.40 +        # things.
    1.41 +        # '<@(json_schema_files)',
    1.42 +      ],
    1.43 +      'outputs': [
    1.44 +        '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).cc',
    1.45 +        '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).h',
    1.46 +      ],
    1.47 +      'action': [
    1.48 +        'python',
    1.49 +        '<(api_gen)',
    1.50 +        '<(RULE_INPUT_PATH)',
    1.51 +        '--root=<(DEPTH)',
    1.52 +        '--destdir=<(SHARED_INTERMEDIATE_DIR)',
    1.53 +        '--namespace=<(root_namespace)',
    1.54 +      ],
    1.55 +      'message': 'Generating C++ code from <(RULE_INPUT_PATH) json files',
    1.56 +      'process_outputs_as_sources': 1,
    1.57 +    },
    1.58 +    {
    1.59 +      'rule_name': 'genapi_idl',
    1.60 +      'msvs_external_rule': 1,
    1.61 +      'extension': 'idl',
    1.62 +      'inputs': [
    1.63 +        '<(api_gen_dir)/any.cc',
    1.64 +        '<(api_gen_dir)/any.h',
    1.65 +        '<(api_gen_dir)/any_helper.py',
    1.66 +        '<(api_gen_dir)/cc_generator.py',
    1.67 +        '<(api_gen_dir)/code.py',
    1.68 +        '<(api_gen_dir)/compiler.py',
    1.69 +        '<(api_gen_dir)/cpp_type_generator.py',
    1.70 +        '<(api_gen_dir)/cpp_util.py',
    1.71 +        '<(api_gen_dir)/h_generator.py',
    1.72 +        '<(api_gen_dir)/idl_schema.py',
    1.73 +        '<(api_gen_dir)/model.py',
    1.74 +        '<(api_gen_dir)/util.cc',
    1.75 +        '<(api_gen_dir)/util.h',
    1.76 +        '<(api_gen_dir)/util_cc_helper.py',
    1.77 +        # TODO(calamity): uncomment this when gyp on windows behaves like other
    1.78 +        # platforms. List expansions of filepaths in inputs expand to different
    1.79 +        # things.
    1.80 +        # '<@(idl_schema_files)',
    1.81 +      ],
    1.82 +      'outputs': [
    1.83 +        '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).cc',
    1.84 +        '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).h',
    1.85 +      ],
    1.86 +      'action': [
    1.87 +        'python',
    1.88 +        '<(api_gen)',
    1.89 +        '<(RULE_INPUT_PATH)',
    1.90 +        '--root=<(DEPTH)',
    1.91 +        '--destdir=<(SHARED_INTERMEDIATE_DIR)',
    1.92 +        '--namespace=<(root_namespace)',
    1.93 +      ],
    1.94 +      'message': 'Generating C++ code from <(RULE_INPUT_PATH) IDL files',
    1.95 +      'process_outputs_as_sources': 1,
    1.96 +    },
    1.97 +  ],
    1.98 +  'include_dirs': [
    1.99 +    '<(SHARED_INTERMEDIATE_DIR)',
   1.100 +    '<(DEPTH)',
   1.101 +  ],
   1.102 +  'dependencies':[
   1.103 +    '<(DEPTH)/tools/json_schema_compiler/api_gen_util.gyp:api_gen_util',
   1.104 +  ],
   1.105 +  'direct_dependent_settings': {
   1.106 +    'include_dirs': [
   1.107 +      '<(SHARED_INTERMEDIATE_DIR)',
   1.108 +    ]
   1.109 +  },
   1.110 +  # This target exports a hard dependency because it generates header
   1.111 +  # files.
   1.112 +  'hard_dependency': 1,
   1.113 +}

mercurial