-
-
Notifications
You must be signed in to change notification settings - Fork 666
Add SCons variant_dir support #1669
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
Add SCons variant_dir support #1669
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commenting "my own" PR because so far I've only rebased. Would like to see if anybody has comments on my comments, otherwise I'll probably just adjust things as I see fet.
537328b
to
55e93ea
Compare
Alright, code wise, I think this is ready now. |
3078526
to
f60cac5
Compare
f60cac5
to
1345c46
Compare
Alright, I tested this, it seems to work. To use it, one has to call |
I tested this in the same way and it worked for me! However, shouldn't this be an option given on the command-line, rather than something that developers hard-code into their project? Why not add this to other default options? Also, this only seemed to affect the build artifacts from godot-cpp itself, and not the test project. What do developers need to do so that their artifacts also build in a separate directory? |
This would be possible! I tested this as well, and arrived at this solution:
As you observed, applying |
We might want to add something like: diff --git a/test/SConstruct b/test/SConstruct
index b949bca..20f62b1 100644
--- a/test/SConstruct
+++ b/test/SConstruct
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-env = SConscript("../SConstruct")
+env = SConscript("../SConstruct", variant_dir=ARGUMENTS.get("variant_dir", None))
# For the reference:
# - CCFLAGS are compilation flags shared between C and C++ to the test SConstruct, or the cpp-template so people can "guess" how to use this feature. But it isn't really important for this PR right now, so let's not block it for this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great! 🎆 🏆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in RocketChat: variant_dir
is only unfeasible on the main repo because of how our code generators are setup. It should be totally fine on godot-cpp!
While this should be given more thorough testing at a later point, this should serve as an entirely functional baseline. Great job getting the ball rolling!
Thanks! |
After this change, Also, there's a bunch of options that take paths, that don't have the |
I think this is a SCons version thing. I normally use SCons 4.0.1, because that's what comes with my distro (Ubuntu 22.04). I tried updating to SCons 4.9.1 via pip, and then this seemed to work fine. We still have |
Hrm, I suppose that means
If SCons comes with 22.04 Ubuntu, it would be unfortunate to increase the minimum requirement beyond that. I'd rather work around the issue for the moment if it's a SCons bug.
Personally, I think so. Assuming we get it to work as intended anyway. |
@Ivorforce I just posted #1819 which fixes this for me
In some further testing, it looks like
Well, it seems we can't rely on |
Supersedes #1439 - it's basically just a rebase. It compiles, but I haven't checked if it does what it says it does (allow godot-cpp to be included from elsewhere).