|
10 | 10 | 'variables': { |
11 | 11 | 'ros_version': '<!(node scripts/ros_distro.js)', |
12 | 12 | 'runtime%': 'node', |
| 13 | + 'ros_lib_dir': "<!(node -p \"require('./scripts/config.js').getROSLibPath()\")", |
| 14 | + 'ros_include_root': "<!(node -p \"require('./scripts/config.js').getROSIncludeRootPath()\")", |
13 | 15 | }, |
14 | 16 | 'targets': [ |
15 | 17 | { |
|
28 | 30 | 'include_dirs': [ |
29 | 31 | '.', |
30 | 32 | "<!(node -e \"require('nan')\")", |
| 33 | + '<(ros_include_root)', |
31 | 34 | ], |
32 | 35 | 'cflags!': [ |
33 | 36 | '-fno-exceptions' |
|
61 | 64 | ], |
62 | 65 | 'cflags_cc': [ |
63 | 66 | '-std=c++20' |
64 | | - ], |
65 | | - 'include_dirs': |
66 | | - [ |
67 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/ ') + '/include/')\")", |
68 | | - ], |
69 | | - 'library_dirs': [ |
70 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/lib/ ') + '/lib/')\")", |
71 | | - ], |
72 | | - 'conditions': [ |
73 | | - [ |
74 | | - 'ros_version > 2105', # Humble, Rolling, ... |
75 | | - { |
76 | | - 'include_dirs': |
77 | | - [ |
78 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/ ') + '/include/')\")", |
79 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rcl/ ') + '/include/rcl')\")", |
80 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rcutils/ ') + '/include/rcutils/')\")", |
81 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rmw/ ') + '/include/rmw/')\")", |
82 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rcl_yaml_param_parser/ ') + '/include/rcl_yaml_param_parser/')\")", |
83 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rosidl_typesupport_interface/ ') + '/include/rosidl_typesupport_interface/')\")", |
84 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rcl_action/ ') + '/include/rcl_action/')\")", |
85 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/action_msgs/ ') + '/include/action_msgs/')\")", |
86 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/service_msgs/ ') + '/include/service_msgs/')\")", |
87 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/unique_identifier_msgs/ ') + '/include/unique_identifier_msgs/')\")", |
88 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/builtin_interfaces/ ') + '/include/builtin_interfaces/')\")", |
89 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rcl_lifecycle/ ') + '/include/rcl_lifecycle/')\")", |
90 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/lifecycle_msgs/ ') + '/include/lifecycle_msgs/')\")", |
91 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rosidl_runtime_c/ ') + '/include/rosidl_runtime_c/')\")", |
92 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rosidl_dynamic_typesupport/ ') + '/include/rosidl_dynamic_typesupport/')\")", |
93 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/type_description_interfaces/ ') + '/include/type_description_interfaces/')\")", |
94 | | - ], |
95 | | - } |
96 | | - ], |
97 | | - ], |
| 67 | + ] |
98 | 68 | } |
99 | 69 | ], |
100 | 70 | [ |
101 | | - 'OS=="win"', |
102 | | - { |
| 71 | + 'OS=="win"', { |
103 | 72 | 'defines': [ |
104 | 73 | 'OS_WINDOWS' |
105 | 74 | ], |
|
108 | 77 | ], |
109 | 78 | 'include_dirs': [ |
110 | 79 | './src/third_party/dlfcn-win32/', |
111 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include ').replace(/\\\/g, '/') + '/include')\")", |
112 | 80 | ], |
113 | 81 | 'msvs_settings': { |
114 | 82 | 'VCCLCompilerTool': { |
115 | 83 | 'ExceptionHandling': '2', # /EHsc |
116 | 84 | }, |
117 | 85 | 'VCLinkerTool': { |
118 | 86 | 'AdditionalDependencies': ['psapi.lib'], |
119 | | - 'AdditionalLibraryDirectories': ["<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '\\\lib ').replace(/\\\/g, '/') + '/lib')\")",], |
| 87 | + 'AdditionalLibraryDirectories': ['<(ros_lib_dir)'], |
120 | 88 | } |
121 | | - }, |
122 | | - 'conditions': [ |
123 | | - [ |
124 | | - 'ros_version > 2105', # Humble, Rolling, ... TODO - not tested due to broken setup_ros v3.3 action on windows |
125 | | - { |
126 | | - 'include_dirs': |
127 | | - [ |
128 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rcl ').replace(/\\\/g, '/') + '/include/rcl')\")", |
129 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rcutils ').replace(/\\\/g, '/') + '/include/rcutils')\")", |
130 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rmw ').replace(/\\\/g, '/') + '/include/rmw')\")", |
131 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rcl_yaml_param_parser ').replace(/\\\/g, '/') + '/include/rcl_yaml_param_parser')\")", |
132 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rosidl_runtime_c ').replace(/\\\/g, '/') + '/include/rosidl_runtime_c')\")", |
133 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rosidl_typesupport_interface ').replace(/\\\/g, '/') + '/include/rosidl_typesupport_interface')\")", |
134 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rcl_action ').replace(/\\\/g, '/') + '/include/rcl_action')\")", |
135 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/action_msgs ').replace(/\\\/g, '/') + '/include/action_msgs')\")", |
136 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/service_msgs ').replace(/\\\/g, '/') + '/include/service_msgs')\")", |
137 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/unique_identifier_msgs ').replace(/\\\/g, '/') + '/include/unique_identifier_msgs')\")", |
138 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/builtin_interfaces ').replace(/\\\/g, '/') + '/include/builtin_interfaces')\")", |
139 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rcl_lifecycle ').replace(/\\\/g, '/') + '/include/rcl_lifecycle')\")", |
140 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/lifecycle_msgs ').replace(/\\\/g, '/') + '/include/lifecycle_msgs')\")", |
141 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rosidl_dynamic_typesupport ').replace(/\\\/g, '/') + '/include/rosidl_dynamic_typesupport')\")", |
142 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/type_description_interfaces/ ').replace(/\\\/g, '/') + '/include/type_description_interfaces/')\")", |
143 | | - ], |
144 | | - } |
145 | | - ] |
146 | | - ] |
| 89 | + } |
147 | 90 | } |
148 | 91 | ], |
149 | 92 | [ |
150 | | - 'OS=="mac"', |
151 | 93 | # TODO - macos is no longer a tier-1 ROS platform and we have no binary ROS builds to test for Humble & Rolling |
152 | | - { |
| 94 | + 'OS=="mac"', { |
153 | 95 | 'defines': [ |
154 | 96 | 'OS_MACOS' |
155 | 97 | ], |
156 | | - 'include_dirs': [ |
157 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/ ') + '/include/')\")", |
158 | | - ], |
159 | | - 'library_dirs': [ |
160 | | - "<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/lib/ ') + '/lib/')\")", |
161 | | - ], |
162 | 98 | 'xcode_settings': { |
163 | 99 | 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', |
164 | 100 | 'CLANG_CXX_LIBRARY': 'libc++', |
|
168 | 104 | } |
169 | 105 | ], |
170 | 106 | [ |
171 | | - 'ros_version<=1911', |
172 | | - { |
| 107 | + 'ros_version <= 1911', { |
173 | 108 | 'libraries': [ |
174 | 109 | '-lrosidl_generator_c' |
175 | 110 | ], |
|
178 | 113 | ] |
179 | 114 | } |
180 | 115 | ], |
181 | | - ['runtime=="electron"', { |
182 | | - "defines": ["NODE_RUNTIME_ELECTRON=1"] |
183 | | - }], |
| 116 | + [ |
| 117 | + # After Galactic, e.g., Humble, Jazzy, Rolling. |
| 118 | + 'ros_version > 2105', { |
| 119 | + 'include_dirs': [ |
| 120 | + "<!@(node -p \"require('./scripts/config.js').getIncludePaths().forEach(p => console.log(JSON.stringify(p)))\")" |
| 121 | + ], |
| 122 | + 'library_dirs': [ |
| 123 | + '<(ros_lib_dir)', |
| 124 | + ] |
| 125 | + } |
| 126 | + ], |
| 127 | + [ |
| 128 | + 'runtime=="electron"', { |
| 129 | + "defines": ["NODE_RUNTIME_ELECTRON=1"] |
| 130 | + } |
| 131 | + ], |
184 | 132 | ] |
185 | 133 | } |
186 | 134 | ] |
|
0 commit comments