Skip to content
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

qt: add preserve_paths keyword to functions #11795

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

bruchar1
Copy link
Member

@bruchar1 bruchar1 commented May 17, 2023

supersedes #10995, as it also handle ui_compile and preprocess, and expose the keyword argument, instead of setting a different default value.

This allow to generate ui and moc under subdirectories, as this is allowed with generic generators.

@bruchar1 bruchar1 requested a review from jpakkane as a code owner May 17, 2023 20:32
@tristan957
Copy link
Contributor

Do you think there is value in adding a test? Overall this looks good to me though. @punytroll do you wanna test this out to make sure your case is covered too?

@tristan957
Copy link
Contributor

superseeds

Funny misspelling :)

@bruchar1
Copy link
Member Author

superseeds

Funny misspelling :)

Oups! Sorry, I'm not English native. What is the correct word?

@eli-schwartz
Copy link
Member

Seems weird to mention in the commit message which other PR this supersedes.

But also I don't see how it is supposed to supersede the other PR?

@tristan957
Copy link
Contributor

@bruchar1 it is supersedes

@@ -55,11 +55,15 @@ foreach qt : ['qt4', 'qt5', 'qt6']
method : get_option('method')
)
# XML files that need to be compiled with the uic tol.
prep += qtmodule.compile_ui(sources : 'mainWindow.ui', method: get_option('method'))
prep += qtmodule.compile_ui(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to extend the test to also use compile_moc?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, I'm not familiar enough with Qt to know now to do a simple test for that. My usecase was for .ui files. I just extended it to moc as well, but in our codebase, it seems the current moc_compile is working without modifications.

@tristan957
Copy link
Contributor

Seems like this comment is all that is left to answer #11795 (comment)

@tristan957
Copy link
Contributor

@eli-schwartz did you have anything more to say on this PR?

@tristan957
Copy link
Contributor

CI failure seems unrelated given it is a fortran test that failed

@tristan957
Copy link
Contributor

@xclaesse @eli-schwartz does this PR look good to either of you? Could be a good vacation present to get this one in! :)

@tristan957 tristan957 added this to the 1.3.0 milestone Jul 25, 2023
@tristan957
Copy link
Contributor

Added to the 1.3.0 milestone, so it isn't left in the dust again.

@bruchar1 bruchar1 changed the title qt: add preserve_path_from keyword to functions qt: add preserve_paths keyword to functions Sep 6, 2023
@bruchar1
Copy link
Member Author

bruchar1 commented Sep 6, 2023

I just simplified it to use a bool instead of a path. Preserving paths from current source dir is probably the only real usecase. If somebody really needs to specify a different path, we could extend it later (or he can simply use a custom_target)

@tristan957
Copy link
Contributor

I think that was a good change. It matches with install_headers

@punytroll
Copy link
Contributor

I just simplified it to use a bool instead of a path. Preserving paths from current source dir is probably the only real usecase. If somebody really needs to specify a different path, we could extend it later (or he can simply use a custom_target)

Thanks for this change. The other solution was, of course, way more general, but, I think, pointlessly so. Thanks, for giving it to the other Qt commands as well!

@punytroll
Copy link
Contributor

I've tested this PR for my use case (qt.compile_moc() with headers) as well and it works beautifully. I hope, this makes it into 1.3.

@bruchar1
Copy link
Member Author

@eli-schwartz @xclaesse Is there anything preventing merging this?

@@ -49,6 +54,11 @@ It takes no positional arguments, and the following keyword arguments:
- `dependencies`: dependency objects whose include directories are used by moc.
- `include_directories` (string | IncludeDirectory)[]: A list of `include_directory()`
objects used when transpiling the .moc files
- `preserve_paths` bool: *New in 1.4.0*. If `true`, specifies that the output
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we typically use Since and not New in. Are you matching something else?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is full of New in ..., but Since is good for me!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I was trying to say if you're being consistent, that is good with me. But whatever you want.

This allow to generate ui and moc under subdirectories,
as this is allowed with generic generators.
@dcbaker dcbaker merged commit f4f50db into mesonbuild:master Feb 12, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants