diff --git a/.github/workflows/mingw_build.yml b/.github/workflows/mingw_build.yml index 6283d91f4..db83839a2 100644 --- a/.github/workflows/mingw_build.yml +++ b/.github/workflows/mingw_build.yml @@ -73,7 +73,7 @@ jobs: # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -G Ninja -DENABLE_LTO=False -DENABLE_ASSERTIONS=True -DENABLE_X86_HOST_DEBUG=True -DENABLE_INTERPRETER=False -DBUILD_TESTS=False -DENABLE_JEMALLOC=False -DENABLE_JEMALLOC_GLIBC_ALLOC=False -DENABLE_LLD=False -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/build/install + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -G Ninja -DENABLE_LTO=False -DENABLE_ASSERTIONS=True -DENABLE_X86_HOST_DEBUG=True -DENABLE_INTERPRETER=False -DBUILD_TESTS=False -DENABLE_JEMALLOC=False -DENABLE_JEMALLOC_GLIBC_ALLOC=False -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/build/install - name: Build working-directory: ${{runner.workspace}}/build diff --git a/CMakeLists.txt b/CMakeLists.txt index 47f45936e..0198b9d4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,8 +13,7 @@ option(ENABLE_CLANG_FORMAT "Run clang format over the source" FALSE) option(ENABLE_IWYU "Enables include what you use program" FALSE) option(ENABLE_LTO "Enable LTO with compilation" TRUE) option(ENABLE_XRAY "Enable building with LLVM X-Ray" FALSE) -option(ENABLE_LLD "Enable linking with lld" FALSE) -option(ENABLE_MOLD "Enable linking with mold" FALSE) +set(USE_LINKER "" CACHE STRING "Allow overriding the linker path directly") option(ENABLE_ASAN "Enables Clang ASAN" FALSE) option(ENABLE_TSAN "Enables Clang TSAN" FALSE) option(ENABLE_ASSERTIONS "Enables assertions in build" FALSE) @@ -157,13 +156,9 @@ endif() set (PTHREAD_LIB pthread) -if (ENABLE_LLD AND ENABLE_MOLD) - message (FATAL_ERROR "Cannot enable both lld and mold") -elseif (ENABLE_LLD) - set (LD_OVERRIDE "-fuse-ld=lld") - add_link_options(${LD_OVERRIDE}) -elseif (ENABLE_MOLD) - add_link_options("-fuse-ld=mold") +if (USE_LINKER) + message(STATUS "Overriding linker to: ${USE_LINKER}") + add_link_options("-fuse-ld=${USE_LINKER}") endif() if (ENABLE_LIBCXX)