diff options
Diffstat (limited to 'build')
-rw-r--r-- | build/json_schema_bundle_compile.gypi | 66 | ||||
-rw-r--r-- | build/json_schema_compile.gypi | 6 |
2 files changed, 70 insertions, 2 deletions
diff --git a/build/json_schema_bundle_compile.gypi b/build/json_schema_bundle_compile.gypi new file mode 100644 index 0000000..1f564d1 --- /dev/null +++ b/build/json_schema_bundle_compile.gypi @@ -0,0 +1,66 @@ +# Copyright (c) 2012 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. + +{ + 'variables': { + # When including this gypi, the following variables must be set: + # json_schema_files: an array of json files that comprise the api model. + # cc_dir: path to generated files + # root_namespace: the C++ namespace that all generated files go under + # Functions and namespaces can be excluded by setting "nocompile" to true. + 'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler', + 'api_gen': '<(api_gen_dir)/compiler.py', + }, + 'actions': [ + { + 'action_name': 'genapi_bundle', + 'inputs': [ + '<(api_gen_dir)/any.cc', + '<(api_gen_dir)/any.h', + '<(api_gen_dir)/any_helper.py', + '<(api_gen_dir)/cc_generator.py', + '<(api_gen_dir)/code.py', + '<(api_gen_dir)/compiler.py', + '<(api_gen_dir)/cpp_type_generator.py', + '<(api_gen_dir)/cpp_util.py', + '<(api_gen_dir)/h_generator.py', + '<(api_gen_dir)/json_schema.py', + '<(api_gen_dir)/model.py', + '<(api_gen_dir)/util.cc', + '<(api_gen_dir)/util.h', + '<(api_gen_dir)/util_cc_helper.py', + '<@(idl_schema_files)', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/chrome/common/extensions/api/generated_api.h', + ], + 'action': [ + 'python', + '<(api_gen)', + '--root=<(DEPTH)', + '--destdir=<(SHARED_INTERMEDIATE_DIR)', + '--namespace=<(root_namespace)', + '--bundle', + '<@(idl_schema_files)', + ], + 'message': 'Generating C++ API bundle code', + 'process_outputs_as_sources': 1, + } + ], + 'include_dirs': [ + '<(SHARED_INTERMEDIATE_DIR)', + '<(DEPTH)', + ], + 'dependencies':[ + '<(DEPTH)/tools/json_schema_compiler/api_gen_util.gyp:api_gen_util', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '<(SHARED_INTERMEDIATE_DIR)', + ] + }, + # This target exports a hard dependency because it generates header + # files. + 'hard_dependency': 1, +} diff --git a/build/json_schema_compile.gypi b/build/json_schema_compile.gypi index b44fe91..6c8f69c 100644 --- a/build/json_schema_compile.gypi +++ b/build/json_schema_compile.gypi @@ -5,7 +5,8 @@ { 'variables': { # When including this gypi, the following variables must be set: - # json_schema_files: an array of json files that comprise the api model. + # json_schema_files: a list of json files that comprise the api model. + # idl_schema_files: a list of IDL files that comprise the api model. # cc_dir: path to generated files # root_namespace: the C++ namespace that all generated files go under # Functions and namespaces can be excluded by setting "nocompile" to true. @@ -53,6 +54,7 @@ }, { 'rule_name': 'genapi_idl', + 'msvs_external_rule': 1, 'extension': 'idl', 'inputs': [ '<(api_gen_dir)/any.cc', @@ -72,7 +74,7 @@ # TODO(calamity): uncomment this when gyp on windows behaves like other # platforms. List expansions of filepaths in inputs expand to different # things. - # '<@(json_schema_files)', + # '<@(idl_schema_files)', ], 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).cc', |