No NDK libraries in clang-tidy pathDeps

Bug: 208310402
Test: WITH_TIDY=1 make tidy-soong
Change-Id: I530fc23a1f6215b8c7f8f2bfcb235d6f58c2a702
diff --git a/cc/builder.go b/cc/builder.go
index 72c2fa5..fea65d5 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -549,6 +549,10 @@
 		return "$" + kind + n
 	}
 
+	// clang-tidy checks source files and does not need to link with libraries.
+	// tidyPathDeps should contain pathDeps but not libraries.
+	tidyPathDeps := skipNdkLibraryDeps(ctx, pathDeps)
+
 	for i, srcFile := range srcFiles {
 		objFile := android.ObjPathWithExt(ctx, subdir, srcFile, "o")
 
@@ -672,7 +676,7 @@
 				Output:      tidyFile,
 				Input:       srcFile,
 				Implicits:   cFlagsDeps,
-				OrderOnly:   pathDeps,
+				OrderOnly:   tidyPathDeps,
 				Args: map[string]string{
 					"ccCmd":     ccCmd,
 					"cFlags":    shareFlags("cFlags", escapeSingleQuotes(moduleToolingFlags)),