diff --git a/CMakeLists.txt b/CMakeLists.txt index c01472a475a..d171a677591 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,11 +221,15 @@ if(NOT MSVC AND NOT EMSCRIPTEN) endif() endif() +# The version of clang currently on our Mac bots doesn't seem to support this flag. +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND (LINUX OR WINDOWS)) + add_link_flag("-fuse-ld=lld") +endif() + if(BYN_ENABLE_LTO) if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") message(FATAL_ERROR "ThinLTO is only supported by clang") endif() - add_link_flag("-fuse-ld=lld") set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=2) set(CMAKE_JOB_POOL_LINK link_job_pool) add_compile_flag("-flto=thin")