[Fuzzer] When building for Fuchsia, add an explicit libc++ dependency
libFuzzer dependes on C++ library, when building for Fuchsia, we
need to ensure that libFuzzer is only being built after libc++
has been built, so we add an explicity dependency on it.
@@ -111,6 +111,11 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND COMPILER_RT_LIBCXX_PATH)
partially_link_libcxx(fuzzer_no_main ${LIBCXX_${arch}_PREFIX} ${arch})
partially_link_libcxx(fuzzer ${LIBCXX_${arch}_PREFIX} ${arch})
endforeach()
+elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia" AND HAVE_LIBCXX)
+ foreach(arch ${FUZZER_SUPPORTED_ARCH})
+ add_dependencies(RTfuzzer.${arch} cxx)
+ add_dependencies(RTfuzzer_main.${arch} cxx)
+ endforeach()
endif()
if(COMPILER_RT_INCLUDE_TESTS)
