-
-
Notifications
You must be signed in to change notification settings - Fork 790
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
Support for grouping targets #1026
Comments
Are you using |
Here I used the |
We can consider adding a new configuration in future versions: target("xx")
set_values("vsxmake.target.group", "xxx") But for version 2.3.9, we will not support this feature. For version 2.3.9, we focus on improving package management. |
No problem. Thank you. Wouldn't it be better to support groups as as target parameter? Groups could be implemented in multiple projects, as far as I know Visual Studio and XCode both support them. But adding support to makefiles could be done as well. For example if I have two projects in the same group (let's say And of course, if a project doesn't support groups they can be safely ignored. |
set_groups("xxx", "yyy")? xmake build xxx yyy? It seems a good idea, I will consider it, but it may not be supported soon. This involves a lot of changes, you may need to wait some time. |
Why not target.set_group? Sure, no problem. I'm already glad you like the idea. 😄 |
only for target. target()
set_group() |
Yes that's what I was suggesting. Seems great! 👍 |
After the current 2.3.9 version is released, I will support it in the next version 2.5.1 and there won't be 2.4.x |
Okay, I've opened a similar issue, so I bring my ideas here. (You can see the original text here: #1172) I think the way Premake handles this is not the best way to do. group("name")
target("first_target")
...
target("second_target")
...
group_end() Alternatively, it may be handled like this: target("first_target")
...
target("second_target")
...
target_end()
group("name", "first_target", "second_target")
#or
group("name", {"first_target", "second_target"}) or maybe it can be handled the same way as Premake does, but I think the better solution here for users would be the first I propose. |
The grouping feature is currently only used in the project generator plugin, and the focus of xmake is on |
Maybe groups could be more useful for xmake, like to build a set of targets. Maybe also set a after build file (like something to execute only after all targets in a group are built). Wouldn't that be interesting? |
This can be achieved using |
At least, can we consider create_group("name", "first_target", "second_target") or create_group("name", {"first_target", "second_target"}) to avoid duplication everywhere? |
I will consider to add |
I have supported for vs project on group branch, but I still don’t support vsxmake, you can try vs project first. #1174 add_rules("mode.debug", "mode.release")
target("test1")
set_kind("binary")
add_files("src/*.cpp")
set_group("group1")
target("test2")
set_kind("binary")
add_files("src/*.cpp")
set_group("group1")
target("test3")
set_kind("binary")
add_files("src/*.cpp")
set_group("group1/group2")
target("test4")
set_kind("binary")
add_files("src/*.cpp")
set_group("group3/group4")
target("test5")
set_kind("binary")
add_files("src/*.cpp")
target("test6")
set_kind("binary")
add_files("src/*.cpp") |
I have also supported it for vsxmake project and merged into dev branch. |
I added source groups for vs/vsxmake generator #2282 |
Is your feature request related to a problem? Please describe.
I'm working on Visual Studio 2019, until now I was using premake to generate my projects. I'm considering replacing it by xmake (because your tool is truly awesome, congrats!) and I'm trying to replicate one feature premake had, groups.
Grouping targets (or projects in premake terms) corresponds to folders in Visual Studio:
Describe the solution you'd like
Some API like
target.set_group
to specify a group.Describe alternatives you've considered
Using a prefix in the target name.
Additional context
Screenshots:
With folders (using Premake):
Without folders (using xmake):
The text was updated successfully, but these errors were encountered: