Change the Ccache config so that it has a much higher hit rate
during compilation, see https://ccache.dev/manual/latest.html#_precompiled_headers
for details.
For Clang, always setting -fno-pch-timestamp seems to be ok, so no need
to special case this depending on whether or not Ccache is used.
Most of the code checks if the SDL2 macro is defined, but a few instances
checked if it was defined and truthy.
Make this consistent and only require the macro to be defined to be
considered.
F16C and FMA were hardcoded into wiMath.h, which conflicts with how CMake
does things. Also those instructions were not used by Jolt in VS because it
expects a similar define to _XM_F16C_INTRINSIC, and only CMake defined
those flags.
This commit causes CMake to set the corresponding DXMath flags, VS
builds will still use the hardcoded #defines.
The VS solution was modified to always define JPH_USE_{F16C,FMADD}
so that Jolt will also use those instructions if possible.
AVX flags are not explicitly set because both Jolt and DXMath set
it implicitly if __AVX__ is defined, which is the case when compiling with /arch:AVX.
Also disable AVX2 by default to be consistent with the VS build.
Windows only supports symlinking as admin or in developer mode.
This commit adds a cmake flag to use symlinking instead of copying.
When enabled, it will check for support and output a hint to enable
developer mode when it fails.
By default, it is disabled on Windows, and enabled otherwise.
by default, if any run of a matrix strategy fails, the others are
stopped immediately. In our case it means that if gcc fails, the
clang build will also fail, which is not what we want.
Change fail-fast to false so that if gcc fails, we can still see if
clang also fails or if it is a gcc specific problem or vice versa.
Those are required, but not supported by older processors
that do support AVX. Omitting these flags in the output
can be confusing, since every required feature seems
to be supported.
Closes#1178
GitHub has the weird restriction that builders in a branch can only
access their own cache as well as the one from "master". Which means
PRs cannot use each others CCache. Therefore the master build was
also updating the cache.
This also means we'll have to compile clang there as well, just so that
the cache can get updated. As with the PR build, the resulting binaries
aren't packaged.
I've also fixed the name for the windows cache, build-pr was using
ccache-win, but build.yml was using win-ccache
This commit also reduces the maximum size to 500MiB, otherwise
the caches can become too big and get deleted by GitHub before they
can be used (the windows one was over 4GiB, and a new one
was created for every PR, quickly exceeding the 10 GB limit)
PR builds will be compiled with both GCC and Clang to more easily spot
errors.
There is still only one Linux artifact, the GCC one.
build.yml and build-nightly.yml will still only use GCC. The only
changes there are switching to ninja and adjusting the name of
the github cache to be consitent with build-pr.
Also the Windows CCache binary was updated to the latest version
* cmake: work around GCC bug when compiling Jolt
* cmake: add build flags for using AVX2 etc.
On linux, AVX2 was used by default for compiling Jolt,
buy not in other parts, which clang doesn't like
(specifically inlining functions using a disabled instruction set)
So now, we just define some compile time options to enable/disable
AVX2, AVX, AVX512 etc. and make the compiler use the code for
everything, not just Jolt. By default, AVX2 is used.
Furthermore, the CMakeLists files were slightly refactored to be
a bit less messy.
* silence GCC warnings
* fix clang build on window
* disable another gcc warning-turned-error
* spring initialization fix
* size_t initializaed to 0 instead of -1
* remove initialization
---------
Co-authored-by: Turánszki János <turanszkij@users.noreply.github.com>
Co-authored-by: Turánszki János <turanszkij@gmail.com>
Some clang versions seem to use int32 for enums unless
explicitly overridden.
Use `enum : uint32_t` will force the type in a compatible
way, this also allows us to get rid of the dummy FORCE_UINT32 enum
members
This also fixes a bug in minimp4 when compiled with clang.
The importer assumed that each light was only referenced once and in
the order it appears in the KHR_lights_punctual extension.
However, glTF allows a light to be referenced by more than one node,
and in different order. This commit adds support for this.