From 223ed705d0d3c3b07f00202a04447df836c05df8 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Thu, 2 May 2019 17:43:48 +0000 Subject: [libc++][CMake] Link against libSystem on Apple platforms Instead of manually linking against libm/librt/libpthread, we should be linking against libSystem on Apple platforms, and only that. libm and libpthread are symlinks to libSystem anyway. llvm-svn: 359808 --- libcxx/src/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libcxx/src') diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt index 3c31548c2c4..5d9cc01d165 100644 --- a/libcxx/src/CMakeLists.txt +++ b/libcxx/src/CMakeLists.txt @@ -140,6 +140,10 @@ function(cxx_link_system_libraries target) target_add_compile_flags_if_supported(${target} PRIVATE "/Zl") target_add_link_flags_if_supported(${target} PRIVATE "/nodefaultlib") + if (LIBCXX_HAS_SYSTEM_LIB) + target_link_libraries(${target} PUBLIC System) + endif() + if (LIBCXX_HAS_PTHREAD_LIB) target_link_libraries(${target} PUBLIC pthread) endif() -- cgit v1.2.3