[libc] add guard for file pieces of printf
authorMichael Jones <michaelrj@google.com>
Mon, 15 Aug 2022 21:25:38 +0000 (14:25 -0700)
committerMichael Jones <michaelrj@google.com>
Mon, 15 Aug 2022 22:43:24 +0000 (15:43 -0700)
commit438d1f18a5b79326eef8ea5455ae1553d2c4d411
tree84e4375c9d6bbd4367a41746f9eb383d3b368f05
parent444b4fda17bca581fab084926b91393bd20478e7
[libc] add guard for file pieces of printf

In the printf_core CMake, the file pieces are defined as object
libraries that depend on the File data structure. If these are added
unconditionally they'll try to evaluate that dependancy even when there
is no File available. This patch adds a guard to prevent that error.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D131921
libc/src/stdio/printf_core/CMakeLists.txt
libc/test/src/stdio/printf_core/parser_test.cpp