Closed rhabacker closed 2 years ago
Add additional issue of the mentioned commit is the usage of set(HAVE_CXX_ATOMIC_WITHOUT_LIB FALSE)
.
According to https://cmake.org/cmake/help/latest/module/CheckCXXSourceCompiles.html
The check is only performed once, with the result cached in the variable named by
<resultVar>
. Every subsequent CMake run will re-use this cached value rather than performing the check again, even if the<code>
changes. In order to force the check to be re-evaluated, the variable named by<resultVar>
must be manually removed from the cache.
Setting it to FALSE
will always return a failed test - it should be unset(HAVE_CXX_ATOMIC_WITHOUT_LIB)
to always run the test or removed completely so that the test is only run on the first call, which is better.
I merged the submission adding the atomic check but as I didn't see an obvious error though it was fine, you are 100% right, the code is wrong. I have fixed the src/vsg/CMakeLists.txt : 3d0260a804d7ca63aa08e57d76ac29a76f1fceef
Could you try this out?
but as I didn't see an obvious error though it was fine
It is not visible on Linux because due to HAVE_CXX_ATOMIC_WITHOUT_LIB
is always false, find_library()
is called and the mentioned library is present. It is noticed with mingw gcc 10 because this library is not present.
Have you tried the fix? 3d0260a804d7ca63aa08e57d76ac29a76f1fceef
You'll need to remove your CMakeCache.text and rebuild from scratch.
Have you tried the fix?
build has been started. I will report back when it is ready.
build has been started. I will report back when it is ready.
build has been finished - the patch works as expected
[ 68s] -- Performing Test HAVE_CXX_ATOMIC_WITHOUT_LIB
[ 68s] -- Performing Test HAVE_CXX_ATOMIC_WITHOUT_LIB - Success
BTW: That the first line was not printed is also an indication that there was something wrong.
Thanks for the testing.
Describe the bug Building vsg with mingw gcc version 10 fails with
To Reproduce
Expected behavior The cmake run should not fail
Desktop (please complete the following information):
Additional context The compiler check introduced with https://github.com/vsg-dev/VulkanSceneGraph/commit/340cc9fb1eec4a9f876ae77ad9486a9a4c6ab925 seems to be incorrect:
Compiling that code always fail
also on linux
Following the hint mentioned by the compiler also did not solve the problem:
According to https://en.cppreference.com/w/cpp/atomic/atomic it should be
Compiling this code works as expected