Skip to content

Conversation

@MarkCallow
Copy link
Contributor

@MarkCallow MarkCallow commented Dec 28, 2025

For deterministic results, on MSVC and CLangCL, set /fp:strict and /fp:precise, on clang -ffp-model=precise and on GNU CC -ffp-contract=off. These result in precise semantics always being used and fused multiply-add never being used,

The source branch for this PR is based on the branch that is the source for PR #411 which is itself based on the source for PR #410 so looking "Files changed here shows the changes from all 3 PRs.

See https://github.com/KhronosGroup/basis_universal/compare/2afafbe..6175e8d to see the FP option-related changes.

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 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.
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.
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.

1 participant