Skip to content

CMake Improvements#403

Closed
MarkCallow wants to merge 7 commits intoBinomialLLC:masterfrom
MarkCallow:cmake_fixes
Closed

CMake Improvements#403
MarkCallow wants to merge 7 commits intoBinomialLLC:masterfrom
MarkCallow:cmake_fixes

Conversation

@MarkCallow
Copy link

@MarkCallow MarkCallow commented Oct 2, 2025

Changes include the following:

  • Prefix option names with BASISU_.
  • Add include files to source list for library project.
  • Fix build of basisu with multi-config generators.
  • Change cmake_minimum_required to 3.16 to avoid CMake warning that compatibility with version 3.10 will be removed.

Updates .gitignore to ignore the runtime output bin directory.

Note that the fix I've made for building basisu with multi-config generators causes bin to be used for the output regardless of the configuration being built so, e.g. a subsequent Debug build will overwrite an existing Release build. Without the fix the build failed because the file strip is told to strip does not exist. It is in either a Debug or Release sub-directory.

@richgel999 please merge this as soon as you can. I will follow up with fixes for various compile warnings.

Commit 9702b74 adds options, defaulting to TRUE, to include basisu and examples` in the configured build and simplification via use of a macro to make common property settings on the two executables.

commit 52c44af adds a further simplification by using setting the OpenCL include directory and library properties on basisu_encoder with the INTERFACE property. CMake then takes care of making sure the executable builds have access to the include and link with the library.

* Prefix option names with `BASISU_`.
* Add include files to source list for library project.
* Fix build of basisu with multi-config generators.
The change at line 13 to use a genex accomplishes the same thing.
using INTERFACE to export OpenCL lib and includes from basisu_encoder
to the applications.
@sehurlburt
Copy link
Contributor

Hi Mark, thanks for your hard work!

Trying to triage this— we require all CMake changes to be tested on OSX, Windows (Visual Studio), and Linux (Ubuntu), and all compiler changes to be tested on Clang, gcc, and MSVC.

When you’re all done with the changes (to minimize testing work), also let us know when you were able to do all the platform tests and if any issues arose. If you are unable to test on all those platforms, just let us know which ones you were able to test on. This helps us plan for the hidden testing/platform fixing part of these types of changes.

Once we get those confirmations we can move forward!

@MarkCallow
Copy link
Author

@sehurlburt I am done for now. Once I actually try to integrate it as a subproject there may be more changes. I can't say. However it will be some time before I get to that stage so I suggest you merge this now. I developed this on macOS. Your CI has tested builds on all three OSes and compilers. There are some apparent errors in the VS2019 build but those same errors appeared in CI runs before my changes. I don't know how many configuration option variants your CI tries.

By the way VS2019 has been removed from GitHub Action runner images so we no longer support building with it in KTX-Software.

This PR contains no changes to the compiler options specified so the focus of testing should be on whether it builds successfully with different options set.

@MarkCallow
Copy link
Author

Closing this in favor of #408.

@MarkCallow
Copy link
Author

Closing this in favor of #411. Thought I'd already closed this.

@MarkCallow MarkCallow closed this Nov 18, 2025
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.

2 participants