bender icon indicating copy to clipboard operation
bender copied to clipboard

Package with only include_dirs doesn't work

Open msmithTT opened this issue 10 months ago • 4 comments

I have a package that just contains include files (global files that define parts of a larger project). If I attempt to create a Bender file for this, for example:

package:
  name: my_package
  authors:
    - "My Name"

sources:
  include_dirs:
    - rtl

  files:

This doesn't generate any +incdir+ command-line options.

If I add a single dummy file to this, then it adds the required +incdir+ command-line options as well as the dummy file:

package:
  name: my_package
  authors:
    - "My Name"

sources:
  include_dirs:
    - rtl

  files:
    - rtl/empty_dummy_module.sv

msmithTT avatar Apr 10 '24 17:04 msmithTT

I think you may be looking for the export_include_dirs functionality.

micprog avatar Apr 10 '24 17:04 micprog

Thanks for the hint, but unfortunately doesn't make a difference.

Using this Bender file:

sources:
  export_include_dirs:
    - rtl

  files:

Then running 'bender script flist' it returns an empty string.

msmithTT avatar Apr 11 '24 16:04 msmithTT

You may want to try the flist-plus script format, which also adds plusargs: +incdir+ and +define+. The flist script type only returns files.

micprog avatar Apr 11 '24 16:04 micprog

Investigating another issue, I found a problem when defining a bender dependency with no source files. I adjusted bender's script export in #167 to keep sourcegroups with no sourcefiles, resulting in a proper export of include directories when no source files are found. I don't know, however, if this is reasonable behavior, as include directories should only be necessary when compiling a source file, and blanket include directories can cause issues for some projects (which is why we can differentiate include directories for individual sourcegroups, although the flist format won't expose this).

micprog avatar Apr 17 '24 12:04 micprog