On 1/13/26 1:17 AM, Albert Astals Cid wrote:
Now that we have a newer cmake we can use CMAKE_VERIFY_INTERFACE_HEADER_SETS

It allows to create a test to check that each of the headers is correctly 
installable on its own.

There is a MR of what the change entails at
https://invent.kde.org/frameworks/karchive/-/merge_requests/80

You can see a pipeline where the test proves it works at
https://invent.kde.org/frameworks/karchive/-/pipelines/1134293

I had modified the code to compile correctly but so that headers would not be 
standalone includeable, see the code at
https://invent.kde.org/frameworks/karchive/-/merge_requests/80/diffs?commit_id=6c3d669f6f49fa38450a8658ff52f8d0e36fe620

Should we add this to all frameworks?

I would need some ECM expert to see if we could make it so less code needs to 
be repeated.

I guess the CMAKE_VERIFY_INTERFACE_HEADER_SETS can go to the 
KDEFrameworkCompilerSettings ?

But what about the add_test?

Cheers,
   Albert

Hi,

cool stuff, I'm in favor.

I gave this a try with KIO, which is our largest and most complex framework, and it works, with caveats: https://invent.kde.org/frameworks/kio/-/merge_requests/2122

> I would need some ECM expert to see if we could make it so less code needs to be repeated.

Not sure there's much we can do, at least without wrapping add_library() or install(), which we historically have avoided

> But what about the add_test?

The KIO experiment tells me that it's better to have one test per sub-library rather than one test for all of them, otherwise we hit the test timeout


Cheers

Nico

Reply via email to