Make CMakeLists easily usable as a subproject and fix build issues#433
Closed
MarkCallow wants to merge 25 commits intoBinomialLLC:masterfrom
Closed
Make CMakeLists easily usable as a subproject and fix build issues#433MarkCallow wants to merge 25 commits intoBinomialLLC:masterfrom
MarkCallow wants to merge 25 commits intoBinomialLLC:masterfrom
Conversation
Convert license info from deprecated .reuse/dep5 to REUSE.toml. Ignore CMakeUserPresets.json, build files in build and output binaries in bin.
* Make it usable as a subproject:
- Don't use CMAKE_ global variables for compiler options.
- Prefix config options with BASISU_ to avoid polluting the namespace.
- Expose libbasisu_encoder's dependencies and link options in its target
interface so they are automatically exported to _any_ application that
links with it.
* Enhancements
- Support building on Android and minGW by handling potential absence
of libpthread.
- Support building with CLangCL.
- Support building on Windows with non-MSVC-front-end compiler so
CMake MSVC variable is not set.
- Set CMAKE_OSX_DEPLOYMENT_TARGET so program built with latest
Xcode SDK will run on build machine with pre-SDK version of macOS.
* Bug Fixes
- Make work with any multi-config CMake generator, not just Visual Studio.
- Only set c++ compile options when compiling c++ files.
- The `STATIC` option, renamed `BASISU_STATIC`, is now set to TRUE by
default because the library is always built as a static library. `STATIC`
is a keyword for the `add_library` command so the `STATIC` option was
ignored there. (The BASISU_ prefix now makes it clear they are
different.) Hence the previous default option of FALSE was incorrect.
- The libraries added when `STATIC` is TRUE are only needed for MinGW
and are now only added for MinGW.
- The rpath setting done when `STATIC` is FALSE is pointless with a
static library but was happening due to the incorrect value of `STATIC`.
- .gitignore files have been added to ignore build files and binaries in
`build` and `bin`, but to not ignore the handful of files in there that
are tracked by git.
* Bugs found but not fixed
- BASISU_SSE is set `if (MSVC)` so it is incorrectly set on Windows ARM
and not set in many other cases where it probably should be.
- Building a dynamic library never happens so `BASISU_STATIC` is
pointless.
Only set -g for debug config. Don't set -fPIC in base options. Quote string arguments to STREQUAL.
* Change PRIVATE to PUBLIC for SSE and OPENCL definitions to propagate them to dependent apps. Fixes failure running `basisu -opencl` when BASISU_OPENCL is set during config. * Change INTERFACE to PRIVATE for OpenCL include directory. basisu_encoder needs this. Apps don't. Fixes build failure on Windows. * Change INTERFACE to PRIVATE for OpenCL link library. Needed if basisu_encoder ever becomes a shared library. When it's a static library, CMake will cause the OpenCL library to be linked to dependent apps. * Set BASISU_SUPPORT_OPENCL=0 when OpenCL not configured. * Make finding OpenCL required for non-Windows when OpenCL configured. Removes need for later checks, allowing code simplification. * Use embedded OpenCL stuff if WIN32 not if MSVC to support use with non-MSVC-front-end compilers.
for the latest fixes.
for latest fixes from master via reuse_ignore.
Remove when issue is fixes in master.
to match usage in the library and usage of BASISU_SUPPORT_SSE. Important now that CMakeLists.txt sets it to 0 when not supported.
Convert license info from deprecated .reuse/dep5 to REUSE.toml. Ignore CMakeUserPresets.json, build files in build and output binaries in bin.
Includes upstream fixes made 2025.11.22.
Convert license info from deprecated .reuse/dep5 to REUSE.toml. Ignore CMakeUserPresets.json, build files in build and output binaries in bin.
Includes upstream fixes as of 2025.12.28.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A repeat of #411 but based on the BU 2.0.
Here are details of the changes.
Make it usable as a subproject:
interface so they are automatically exported to any application that
links with it.
Enhancements
basisubuild. It is built by default.of libpthread.
means CMake's MSVC variable is not set.
Xcode SDK will run on build machine with pre-SDK version of macOS.
Bug Fixes
BASISU_STATIC, to TRUE because the library isalways built as a static library.
STATICis TRUE are only needed for MinGWand are now only added for MinGW.
STATICis FALSE is pointless with astatic library but was happening due to the incorrect default of
BASISU_STATIC.buildandbin, but to not ignore the handful of files in there thatare tracked by git.
Bugs found but not fixed
if (MSVC)so it is incorrectly set on Windows ARMand not set in many other cases where it probably should be. MSVC does
not mean the SSE is available.
BASISU_STATICispointless.
This incorporates the WASM and Python stuff largely unchanged. I have not tested it as I do not have the build environment set up.
It includes the FP option setting stuff from my earlier PR. Since your 2.0 release announcement said it produces deterministic results I'm not sure it is still needed. As it is in a single block, it can easily be removed. Let me know.