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 more options to control which CMake targets are created #686

Open
AntonShalgachev opened this issue Apr 14, 2023 · 5 comments
Open

Add more options to control which CMake targets are created #686

AntonShalgachev opened this issue Apr 14, 2023 · 5 comments

Comments

@AntonShalgachev
Copy link

Hi!
I've noticed that CMakeLists.txt includes several targets by default with no option to prevent that. For example, both ktx and ktx_read would be added (leading to compilation of both targets when building the app regardless of which target is linked to it). Also obj_basisu_cbind and objUtil are always added (but looks like they are unused by the core library)
Apart from that ktx always includes ASTC encoder and basisu encoder, which might not always be desired

My current setup is that I use libktx as a CMake dependency (via FetchContent). My project consists of 2 parts: a simple offline tool which saves the input image data to the ktx2 format without encoding; and a renderer which only needs to read the ktx2 file without transcoding.
My ideal setup would be that I could disable everything I don't need, leaving only a basic library with the read/write functionality

Would that be in line with the project to add additional CMake options to conditionally skip adding some targets? If yes, I can try to come up with a PR

@MarkCallow
Copy link
Collaborator

PRs for the following changes are acceptable:

  • Build only ktx_read. Must disable tests. I think this may be the case already.
  • Don't include obj_basisu_cbind unless the tests are being built. I think this may the case currently. It is only used by the transcode tests.
  • Don't include objUtil unless tools or loadtests are being built. If this isn't the case I'd be surprised. The only part of objUtil that is used by the core library is unused.h which doesn't require the library to be built.

It's best to wait a month or so before creating PRs for these as some big changes are coming ...

The following are unacceptable

  • Omitting the transcoder from ktx or ktx_read.
  • Omitting the encoders from ktx.

@AntonShalgachev
Copy link
Author

Great, thanks for the confirmation
I'll wait then for those big changes you mentioned before looking further into that

@MarkCallow
Copy link
Collaborator

Those big changes are in main now.

@MarkCallow
Copy link
Collaborator

@AntonShalgachev Do you still plan to provide a PR? I think the only thing to be done here is make it possible to build only one of ktx or ktx_read.

@AntonShalgachev
Copy link
Author

I'm still interested in having this change, but I won't be able to find time for a PR in the foreseeable future (I've switched to something else at the moment). If anyone else would need this feature earlier and would find some time for a PR, I'll happily let them do it :) Otherwise I can look into it once I'm back on the ktx topic

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

No branches or pull requests

2 participants