diff --git a/compiler-rt/test/profile/CMakeLists.txt b/compiler-rt/test/profile/CMakeLists.txt --- a/compiler-rt/test/profile/CMakeLists.txt +++ b/compiler-rt/test/profile/CMakeLists.txt @@ -8,6 +8,10 @@ if(NOT APPLE AND COMPILER_RT_HAS_LLD AND "lld" IN_LIST LLVM_ENABLE_PROJECTS) list(APPEND PROFILE_TEST_DEPS lld) endif() + # Profile tests use C++ standard library headers. + if (TARGET cxx-headers OR HAVE_LIBCXX) + set(PROFILE_TEST_DEPS cxx-headers) + endif() endif() set(PROFILE_TEST_ARCH ${PROFILE_SUPPORTED_ARCH})