diff --git a/cmake/ConfigureCompiler.cmake b/cmake/ConfigureCompiler.cmake index 71b80e7ef6..f212f58018 100644 --- a/cmake/ConfigureCompiler.cmake +++ b/cmake/ConfigureCompiler.cmake @@ -199,6 +199,10 @@ else() endif() if (CLANG) add_compile_options() + # Clang has link errors unless `atomic` is specifically requested. + if(NOT APPLE) + add_link_options(-latomic) + endif() if (APPLE OR USE_LIBCXX) add_compile_options($<$:-stdlib=libc++>) add_compile_definitions(WITH_LIBCXX)