| OLD | NEW |
| (Empty) | |
| 1 # Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 # This file is meant to be included into a target to provide a rule to invoke |
| 6 # the flatc compiler in a consistent manner. |
| 7 # |
| 8 # To use this, create a gyp target with the following form: |
| 9 # { |
| 10 # 'target_name': 'my_flatc_lib', |
| 11 # 'type': 'static_library', |
| 12 # 'sources': [ |
| 13 # 'foo.fbs', |
| 14 # ], |
| 15 # 'variables': { |
| 16 # 'flatc_out_dir': 'dir/for/my_flatc_lib' |
| 17 # }, |
| 18 # 'includes': ['path/to/this/gypi/file'], |
| 19 # 'dependencies': [ |
| 20 # '<(DEPTH)/third_party/flatbuffers/flatbuffers.gyp:flatbuffers', |
| 21 # ] |
| 22 # } |
| 23 { |
| 24 'variables': { |
| 25 'flatc': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)flatc<(EXECUTABLE_SUFFIX)', |
| 26 'cc_dir': '<(SHARED_INTERMEDIATE_DIR)/flatc_out/<(flatc_out_dir)', |
| 27 }, |
| 28 'rules': [ |
| 29 { |
| 30 'rule_name': 'genflatc', |
| 31 'extension': 'fbs', |
| 32 'inputs': [ |
| 33 '<(flatc)', |
| 34 ], |
| 35 'outputs': [ |
| 36 '<(cc_dir)/<(RULE_INPUT_ROOT)_generated.h', |
| 37 ], |
| 38 'action': [ |
| 39 '<(flatc)', |
| 40 '-c', |
| 41 '-o', |
| 42 '<(cc_dir)', |
| 43 '<(RULE_INPUT_PATH)' |
| 44 ], |
| 45 'message': 'Generating C++ code from <(RULE_INPUT_PATH)', |
| 46 'process_outputs_as_sources': 1, |
| 47 } |
| 48 ], |
| 49 'dependencies': [ |
| 50 '<(DEPTH)/third_party/flatbuffers/flatbuffers.gyp:flatc', |
| 51 ], |
| 52 'include_dirs': [ |
| 53 '<(SHARED_INTERMEDIATE_DIR)/flatc_out', |
| 54 '<(DEPTH)', |
| 55 ], |
| 56 'direct_dependent_settings': { |
| 57 'include_dirs': [ |
| 58 '<(SHARED_INTERMEDIATE_DIR)/flatc_out', |
| 59 '<(DEPTH)', |
| 60 ] |
| 61 }, |
| 62 'export_dependent_settings': [ |
| 63 # The generated headers reference headers within flatbuffers, |
| 64 # so dependencies must be able to find those headers too. |
| 65 '<(DEPTH)/third_party/flatbuffers/flatbuffers.gyp:flatbuffers', |
| 66 ], |
| 67 # This target exports a hard dependency because it generates header |
| 68 # files. |
| 69 'hard_dependency': 1, |
| 70 } |
| OLD | NEW |