| 1 |
# sigc++/adaptors/lambda |
| 2 |
|
| 3 |
# Input: maintainer_mode, python3, handle_built_files, m4_template, m4_include_dir |
| 4 |
# Input and output: built_h_files, built_cc_files, built_h_file_targets, |
| 5 |
# built_cc_file_targets |
| 6 |
|
| 7 |
# .m4 files to build .h and .cc files from. |
| 8 |
adaptors_lambda_cc_m4_files = [ |
| 9 |
'lambda.cc', |
| 10 |
] |
| 11 |
adaptors_lambda_h_m4_files = [ |
| 12 |
'base.h', |
| 13 |
'select.h', |
| 14 |
] |
| 15 |
foreach file : adaptors_lambda_h_m4_files |
| 16 |
built_h_files += 'adaptors' / 'lambda' / file |
| 17 |
endforeach |
| 18 |
foreach file : adaptors_lambda_cc_m4_files |
| 19 |
built_cc_files += 'adaptors' / 'lambda' / file |
| 20 |
endforeach |
| 21 |
|
| 22 |
if maintainer_mode |
| 23 |
# Maintainer mode. Generate .h and .cc files from .m4 files in macros/ directory. |
| 24 |
foreach file : adaptors_lambda_cc_m4_files + adaptors_lambda_h_m4_files |
| 25 |
built_file_target = custom_target('adaptors_lambda_' + file, |
| 26 |
input: 'macros' / file + '.m4', |
| 27 |
output: file, |
| 28 |
command: [ |
| 29 |
python3, handle_built_files, 'build_from_m4', |
| 30 |
m4_include_dir, |
| 31 |
'@INPUT@', |
| 32 |
'@OUTPUT@', |
| 33 |
], |
| 34 |
depend_files: m4_template, |
| 35 |
build_by_default: maintainer_mode, |
| 36 |
install: false, |
| 37 |
) |
| 38 |
if file.endswith('.cc') |
| 39 |
built_cc_file_targets += built_file_target |
| 40 |
else |
| 41 |
built_h_file_targets += built_file_target |
| 42 |
endif |
| 43 |
endforeach |
| 44 |
endif |