Open NOhs opened 3 years ago
In the first example, the dependencies should be "additional_includes"
and in the second example the target [additional_includes]
should be called [shared_headers]
, right?
I agree, it would be good to check for a directory with the target's name in any case. Then deviating from this default requires adding a directory = "..."
.
When a target is the only target, no directory is specified and no folder with the target name is found, then the project directory should be searched for sources, but never otherwise.
I updated the second example. The first one I copy-pasted from the existing documentation. But you are right, the dependency has to be fixed in that example.
In TargetDescription
, we currently have
@property
def root_directory(self):
if self._download_directory:
return self._download_directory / self._relative_directory
else:
return self.parent_project.directory / self._relative_directory
which could easily be replaced by
@property
def root_directory(self):
if self._download_directory:
return self._download_directory / self._relative_directory
elif self._relative_directory:
return self.parent_project.directory / self._relative_directory
elif (self.parent_project.directory / self.name).exists():
return self.parent_project.directory / self.name
else:
return self.parent_project.directory
The current example for clang_build for multiple targets is:
I would argue that the following TOML should be sufficient:
The header-only should already work. The "directory" part currently does not work. I think the current implementation was chosen to allow for single named targets not requiring a subfolder. I am wondering if we should instead opt for another exception for single targets to allow for the simple toml file above to work.
Note that this would also encourage people to not name their folders differently to their targets in the toml file which would overall make it easier to navigate such projects.