| Zane Shelley | ba5dc16 | 2020-11-09 21:47:55 -0600 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- | 
 | 2 | # Chip Data Files | 
 | 3 | #------------------------------------------------------------------------------- | 
 | 4 |  | 
 | 5 | build_cdb = find_program('build_chip_data_binary') | 
 | 6 |  | 
 | 7 | # The key for each entry in this dictionary is a subdirectory containing XML for | 
 | 8 | # a chip model. The value for each entry contains the expected output files that | 
 | 9 | # will be produced for each chip model. It is important to note that the script | 
 | 10 | # will generate all output files, regardless of what is listed, when the script | 
 | 11 | # is run. However, this list must be kept in sync with the expected output so | 
 | 12 | # that meson will know to run the script when an output file has changed or is | 
 | 13 | # missing. | 
 | 14 | cdb_files = { | 
 | 15 |     'p10' : | 
 | 16 |     [ | 
 | 17 |         'chip_data_p10_10.cdb', | 
 | 18 |     ], | 
 | 19 |  | 
 | 20 |     'explorer' : | 
 | 21 |     [ | 
| Zane Shelley | d6826e5 | 2020-11-10 17:39:00 -0600 | [diff] [blame] | 22 |         'chip_data_explorer_11.cdb', | 
 | 23 |         'chip_data_explorer_20.cdb', | 
| Zane Shelley | ba5dc16 | 2020-11-09 21:47:55 -0600 | [diff] [blame] | 24 |     ], | 
 | 25 | } | 
 | 26 |  | 
 | 27 | foreach chip_dir, out_files : cdb_files | 
 | 28 |  | 
 | 29 |     source_dir = meson.current_source_dir() + '/' + chip_dir | 
 | 30 |     build_dir  = meson.current_build_dir() | 
 | 31 |  | 
 | 32 |     # Get all XML files in the chip directory. This is a bit of a workaround | 
 | 33 |     # because meson does not allow wildcards. | 
 | 34 |     xml_list = run_command('xml_list.sh', source_dir) | 
 | 35 |     in_files = xml_list.stdout().strip().split('\n') | 
 | 36 |  | 
 | 37 |     custom_target('build_cdb_' + chip_dir, build_by_default : true, | 
 | 38 |                   input : in_files, output : out_files, | 
 | 39 |                   command : [ build_cdb, '-i', source_dir, '-o', build_dir ], | 
 | 40 |                   install : true, | 
 | 41 |                   install_dir : join_paths(get_option('prefix'), | 
 | 42 |                                            get_option('datadir'), | 
 | 43 |                                            meson.project_name())) | 
 | 44 |  | 
 | 45 | endforeach | 
 | 46 |  |