diff --git a/cmake/compiler_flags.cmake b/cmake/compiler_flags.cmake index 648c7f37f..1040b1a2c 100644 --- a/cmake/compiler_flags.cmake +++ b/cmake/compiler_flags.cmake @@ -52,8 +52,10 @@ endif() if(APPLE) if(WITH_STATIC_CRT) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lc++abi ${LLVM_PATH}/lib/libc++.a") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lc++abi ${LLVM_PATH}/lib/libc++.a") + file(GLOB_RECURSE libcpp_file "${LLVM_PATH}/lib/**/libc++.a") + message(STATUS "Using libc++ in ${libcpp_file}" ) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lc++abi ${libcpp_file}") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lc++abi ${libcpp_file}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdlib++") endif() endif()