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

Add preserve_path_from argument when running moc in headers mode. #10995

Closed
wants to merge 1 commit into from

Conversation

punytroll
Copy link
Contributor

This fixes #10955 partially.

When using the sources kwarg, the moc tool generates .moc files. Those are meant to be #included in a .cpp file, which makes it necessary to add the correct -Ibuild/dir flag to the correct .cpp file compiling command. I'm not sure whether this is wanted or even possible ...

@codecov
Copy link

codecov bot commented Nov 4, 2022

Codecov Report

Merging #10995 (e3df907) into master (97ec20e) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master   #10995      +/-   ##
==========================================
- Coverage   68.33%   68.30%   -0.03%     
==========================================
  Files         412      412              
  Lines       87789    87855      +66     
  Branches    20708    20724      +16     
==========================================
+ Hits        59990    60009      +19     
- Misses      23303    23348      +45     
- Partials     4496     4498       +2     
Impacted Files Coverage Δ
mesonbuild/modules/qt.py 75.09% <100.00%> (ø)
scripts/env2mfile.py 14.49% <0.00%> (-0.81%) ⬇️
mesonbuild/scripts/env2mfile.py 14.49% <0.00%> (-0.81%) ⬇️
compilers/detect.py 46.60% <0.00%> (-0.36%) ⬇️
modules/hotdoc.py 65.48% <0.00%> (-0.35%) ⬇️
mesonbuild/modules/hotdoc.py 65.48% <0.00%> (-0.35%) ⬇️
interpreter/primitives/string.py 98.54% <0.00%> (+0.09%) ⬆️
mesonbuild/interpreter/primitives/string.py 98.54% <0.00%> (+0.09%) ⬆️
compilers/asm.py 52.34% <0.00%> (+0.32%) ⬆️
mesonbuild/compilers/asm.py 52.34% <0.00%> (+0.32%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@tristan957
Copy link
Contributor

Would be useful if you edit an existing compile_moc test to run into the same issues that you ran into

@punytroll
Copy link
Contributor Author

punytroll commented Nov 13, 2022

Hey @tristan957 ,
finally got time to do this. :) I think that would be beneficial; you're right.
Unfortunately I have no clue, where to put the test. It seems test cases/frameworks/4 qt is a good place, but there is so much stuff in there. Can I just add a subdirectory with a self-sufficient test case? And what to name it? After the original issue?

Update: I really have no clue how to set this up! I cannot enter directories multiple times but directories is an integral part of the test, so I can only check one Qt version. I'll try Qt6 then.

@punytroll
Copy link
Contributor Author

OK, I added a test setup. I am not at all happy to restrict the test to Qt 6 but I wouldn't know how else to do it. Also, having this test not as a self-contained entity but as part of this all-encompassing Qt module test is frustrating to say the least. There is no guessing of how much these tests might interact with each other and having some arbitrary directories one and two in here is confusing for everybody after me. Can this be done any more sensible?

@tristan957
Copy link
Contributor

@xclaesse maybe you can provide some testing guidance?

@punytroll
Copy link
Contributor Author

Any further thoughts on this? I'd like to see this functionality added at some point in the future ... :)

@tristan957
Copy link
Contributor

@eli-schwartz could you help provide input? Ideally this could go in before 1.0.0 :)

@punytroll
Copy link
Contributor Author

Some time has passed and again, I am in need of this change. Is there something I can do to get this along?

@tristan957
Copy link
Contributor

cc @eli-schwartz | @xclaesse. Could we get this in for 1.1.0?

@bruchar1
Copy link
Member

👍 I need this feature too.

Would be useful to add this to compile_resources and compile_ui as well.

I would rather add the preserve_path_from to each function, and update documentation accordingly. Will require a release snippet as well.

bruchar1 added a commit to bruchar1/meson that referenced this pull request May 17, 2023
superseeds mesonbuild#10995.

This allow to generate ui and moc under subdirectories,
as this is allowed with generic generators.
@eli-schwartz
Copy link
Member

@punytroll I think maybe this would be much more palatable to you if we just changed the test itself to be parameterized by Qt version using an option plus test.json, rather than doing it in a foreach loop?

Would that be sufficient or do you really desire that it be run as multiple different test case directories each testing one or two things? (I'm not entirely sure I see the necessity of this, but maybe I'm missing something.)

@punytroll punytroll closed this Jul 2, 2023
@punytroll punytroll deleted the qtmocpaths branch July 2, 2023 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Qt compile_moc() doesn't support files with the same name
4 participants