-
Notifications
You must be signed in to change notification settings - Fork 318
Set compile options for uniform FP handling across compilers and platforms #418
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
Open
MarkCallow
wants to merge
15
commits into
BinomialLLC:master
Choose a base branch
from
KhronosGroup:set_fp_options
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
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.
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.
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.