-
-
Notifications
You must be signed in to change notification settings - Fork 617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow specifying root directory for the project sources #2129
Comments
I wonder if |
I thought I could use |
|
I have the exact same issue on my projects, I want to be able to set a base/src directory that all paths on a project should be relative to. From the description, it seems that I have been trying to study what exactly it does, and it seems like it does pretty much the same job as Here are the relevant references:
function p.workspace.bake(self)
...
self.location = self.location or self.basedir
context.basedir(self, self.location)
...
end
function fileconfig.new(fname, prj)
...
context.basedir(fcfg, prj.location)
...
end
function context.basedir(ctx, basedir)
ctx._basedir = basedir or ctx._basedir
return ctx._basedir
end
function premake.filename(obj, ext)
local fname = obj.location or obj.basedir
...
end
We also only have 3 single tests for @samsinsane @Jarod42 Do you know what |
From https://premake.github.io/docs/basedir/
So it is not the api you want.
I think it is an option to try. Following won't "work"
or if it works, behavior is mostly different than other field... It is a risky task IMO, ( |
To be honest, I do not understand what this API really does or is supposed to do, so not going to make any assumptions based on what the docs currently say.
Introducing a new To fix the issue you have identified, these paths could have the prefix set whenever you set their values, so changing it mid scope would work as it would take effect right away. Though I don't really see this issue as too much of a problem, this is an advanced feature anyway, and with proper documentation the behavior (and potential foot guns) can be explained to users. But I would like to understand what the hell |
For various reasons, I can't have Premake files in the root directory of the project, but have to put it into a subdirectory, let's call it
build/premake
. This means that even my simplest project definitions look like this:Having to write
srcdir ..
everywhere is aggravating.My existing build system allows to do this instead
and I find this much more convenient.
So I wonder if a similar option could be added to Premake? I'd be willing to implement it, but I'd appreciate any hints about how to do it because I am not sure how to get an option set at the current project level in
translate()
function which is where, I think, prepending ofsrcdir
should be implemented.The text was updated successfully, but these errors were encountered: