diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3c965666fd5..274aa186c8e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -103,10 +103,12 @@ jobs: variables: CI_OS: osx ARCH: x86_64 - BOOTSTRAP_CMAKE_FLAGS: -DBUILD_LTO_LIBS=ON + BOOTSTRAP_CMAKE_FLAGS: > + -DBUILD_LTO_LIBS=ON + -DD_COMPILER_FLAGS=-gcc=/usr/bin/c++ EXTRA_CMAKE_FLAGS: > -DBUILD_LTO_LIBS=ON - -DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto" + -DD_COMPILER_FLAGS="-gcc=/usr/bin/c++ -O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto" -DEXTRA_CXXFLAGS=-flto=full MACOSX_DEPLOYMENT_TARGET: 10.12 IOS_DEPLOYMENT_TARGET: 12.0 @@ -132,10 +134,11 @@ jobs: - job: macOS_arm64 timeoutInMinutes: 120 pool: - vmImage: 'macOS-10.15' + vmImage: 'macOS-11' variables: CI_OS: osx ARCH: arm64 + BOOTSTRAP_CMAKE_FLAGS: -DD_COMPILER_FLAGS=-gcc=/usr/bin/c++ EXTRA_CMAKE_FLAGS: > -DBUILD_LTO_LIBS=ON -DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto" diff --git a/cmake/Modules/BuildDExecutable.cmake b/cmake/Modules/BuildDExecutable.cmake index 2ad89620ca4..32101dafd5c 100644 --- a/cmake/Modules/BuildDExecutable.cmake +++ b/cmake/Modules/BuildDExecutable.cmake @@ -94,7 +94,7 @@ function(build_d_executable target_name output_exe d_src_files compiler_args lin translate_linker_args(full_linker_args translated_linker_args) # We need to link against the C++ runtime library. - if(NOT MSVC AND "${D_COMPILER_ID}" STREQUAL "LDMD") + if(NOT MSVC AND "${D_COMPILER_ID}" STREQUAL "LDMD" AND NOT "${dflags}" MATCHES "(^|;)-gcc=") set(translated_linker_args "-gcc=${CMAKE_CXX_COMPILER}" ${translated_linker_args}) endif()