blob: 4d9fec2915b5e60b6fdc4817bce4519cbb1a7493 [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001# Include this file in any target that needs to use files generated from queue
2# etc. definitions.
3#
4# To use, create a target of the following form:
5# {
6# 'target_name': 'my_queues',
7# 'type': 'static_library', # or any other type that can handle .cc files
8# 'sources': [
9# 'aos/example/Queue.q',
10# 'aos/example/ControlLoop.q',
11# ],
12# 'variables': {
13# 'header_path': 'aos/example',
14# },
15# 'includes': ['path/to/queues.gypi'],
16# },
17# Code that depends on this target will be able to #include
18# "aos/example/Queue.q.h" and "aos/example/ControlLoop.q.h".
19#
20# using <http://src.chromium.org/svn/trunk/src/build/protoc.gypi> as an
21# example of how this should work
22{
23 'variables': {
brians343bc112013-02-10 01:53:46 +000024 'prefix_dir': '<(SHARED_INTERMEDIATE_DIR)/<!(echo <(header_path) | sed "s/[^A-Za-z0-9]/_/g")',
25 'out_dir': '<(prefix_dir)/<(_target_name)/<(header_path)',
brians343bc112013-02-10 01:53:46 +000026 'output_h': '<(out_dir)/<(RULE_INPUT_ROOT).q.h',
27 'output_cc': '<(out_dir)/<(RULE_INPUT_ROOT).q.cc',
brians343bc112013-02-10 01:53:46 +000028 'no_rsync': 1,
Brian Silverman65f80962014-02-22 12:34:18 -080029 'aos_q_dependent_paths%': [],
brians343bc112013-02-10 01:53:46 +000030 },
31 'rules': [
32 {
33 'variables': {
34 'script': '<(AOS)/build/queues/compiler.rb',
35 },
36 'rule_name': 'genqueue',
37 'extension': 'q',
38 'outputs': [
39 '<(output_h)',
40 '<(output_cc)',
41 ],
brians343bc112013-02-10 01:53:46 +000042 'inputs': [
43 '<(script)',
44 '<!@(find <(AOS)/build/queues/ -name *.rb)',
45 '<(AOS)/common/queue.h',
46 '<(AOS)/common/time.h',
Brian Silverman65f80962014-02-22 12:34:18 -080047 '>@(aos_q_dependent_paths)',
brians343bc112013-02-10 01:53:46 +000048 ],
49 'action': ['ruby', '<(script)',
brians343bc112013-02-10 01:53:46 +000050 '-I', '<(DEPTH)',
51 '<(RULE_INPUT_PATH)',
52 '-cpp_out',
53 '<(header_path)',
54 '-cpp_base',
55 '<(prefix_dir)/<(_target_name)'],
Brian Silvermancbbc3c42014-02-22 18:33:17 -080056 'message': 'Generating C++ code for <(header_path)/<(RULE_INPUT_PATH)',
brians343bc112013-02-10 01:53:46 +000057 'process_outputs_as_sources': 1,
58 },
brians343bc112013-02-10 01:53:46 +000059 ],
brians343bc112013-02-10 01:53:46 +000060 'include_dirs': [
brians343bc112013-02-10 01:53:46 +000061 '<(prefix_dir)/<(_target_name)',
62 ],
63 'direct_dependent_settings': {
64 'include_dirs': [
65 '<(prefix_dir)/<(_target_name)',
66 ],
67 'variables': {
Brian Silverman65f80962014-02-22 12:34:18 -080068 'aos_q_dependent_paths': ['<@(_sources)'],
brians343bc112013-02-10 01:53:46 +000069 },
70 },
Brian Silverman8dc9fd42014-02-10 13:35:43 -080071 'dependencies': [
72 '<(AOS)/common/common.gyp:queues',
Brian Silverman665e60c2014-02-12 13:57:10 -080073 '<(AOS)/common/common.gyp:once',
Brian Silverman04fdc232014-02-12 14:51:11 -080074 '<(AOS)/common/common.gyp:queue_types',
Brian Silverman8dc9fd42014-02-10 13:35:43 -080075 ],
76 'export_dependent_settings': [
77 '<(AOS)/common/common.gyp:queues',
78 ],
brians343bc112013-02-10 01:53:46 +000079 'hard_dependency': 1,
80}