Multiple executables or tests in the same directory
Opened this issue · 2 comments
Right now, program source files can not be placed in the same folder. The build system sees the other program source files and assumes they are modules. We should discuss whether this restriction should be clearly identified in the user documentation, or whether we want to try and support having multiple program sources in the same folder.
The main use case I can see for allowing this would be to have modules common to multiple programs or tests, but not included in the library. I would generally be of the opinion that such a situation calls for either putting those modules in the library, or putting them into their own separate library. And by not supporting it, it encourages users to do things the right way.
I think Cargo allows to have programs in subdirectories of bin/
, and I think it's one executable per subdirectory, and other files are just linked to it. I think that's fine.
Finally, all programs in bin/
directory directly are all separate programs and I think only programs are allowed there.
I think we can follow exactly the same approach.