CereLink
CereLink copied to clipboard
cbsdk_static needs to link (PUBLIC) atomic on some platforms
# Check if we need to link libatomic (required on some platforms for atomic ops)
include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
#include <atomic>
int main() {
std::atomic<int> x;
x.exchange(1);
return 0;
}
" HAVE_CXX_ATOMICS_WITHOUT_LIB)
if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
# Try with -latomic
set(CMAKE_REQUIRED_LIBRARIES atomic)
check_cxx_source_compiles("
#include <atomic>
int main() {
std::atomic<int> x;
x.exchange(1);
return 0;
}
" HAVE_CXX_ATOMICS_WITH_LIB)
unset(CMAKE_REQUIRED_LIBRARIES)
if(HAVE_CXX_ATOMICS_WITH_LIB)
target_link_libraries(cbsdk_static PUBLIC atomic)
endif()
endif()
This wasn't fixed with that commit... the ubuntu-latest runner was still reporting the atomic-related errors.