[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / libc / src / stdio / printf_core / CMakeLists.txt
blob8da274395526df65bcd8fedb74511df12fbf321c
1 if(LIBC_CONF_PRINTF_DISABLE_FLOAT)
2   list(APPEND printf_config_copts "-DLIBC_COPT_PRINTF_DISABLE_FLOAT")
3 endif()
4 if(LIBC_CONF_PRINTF_DISABLE_INDEX_MODE)
5   list(APPEND printf_config_copts "-DLIBC_COPT_PRINTF_DISABLE_INDEX_MODE")
6 endif()
7 if(LIBC_CONF_PRINTF_DISABLE_WRITE_INT)
8   list(APPEND printf_config_copts "-DLIBC_COPT_PRINTF_DISABLE_WRITE_INT")
9 endif()
10 if(LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE)
11   list(APPEND printf_config_copts "-DLIBC_COPT_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE")
12 endif()
13 if(printf_config_copts)
14   list(PREPEND printf_config_copts "COMPILE_OPTIONS")
15 endif()
17 add_header_library(
18   printf_config
19   HDRS
20     printf_config.h
21   ${printf_config_copts}
24 add_header_library(
25   core_structs
26   HDRS
27     core_structs.h
28   DEPENDS
29     libc.src.__support.CPP.string_view
30     libc.src.__support.FPUtil.fp_bits
33 add_header_library(
34   parser
35   HDRS
36     parser.h
37   DEPENDS
38     .core_structs
39     libc.src.__support.arg_list
40     libc.src.__support.ctype_utils
41     libc.src.__support.str_to_integer
42     libc.src.__support.CPP.bit
43     libc.src.__support.CPP.optional
44     libc.src.__support.CPP.string_view
45     libc.src.__support.CPP.type_traits
46     libc.src.__support.common
49 add_object_library(
50   writer
51   SRCS
52     writer.cpp
53   HDRS
54     writer.h
55   DEPENDS
56     .core_structs
57     libc.src.__support.CPP.string_view
58     libc.src.__support.macros.optimization
59     libc.src.string.memory_utils.inline_memcpy
60     libc.src.string.memory_utils.inline_memset
63 add_object_library(
64   converter
65   SRCS
66     converter.cpp
67   HDRS
68     converter.h
69     converter_atlas.h
70     converter_utils.h
71     string_converter.h
72     char_converter.h
73     int_converter.h
74     ptr_converter.h
75     write_int_converter.h
76     float_inf_nan_converter.h
77     float_hex_converter.h
78     float_dec_converter.h
79   DEPENDS
80     .writer
81     .core_structs
82     .printf_config
83     libc.src.__support.CPP.limits
84     libc.src.__support.CPP.span
85     libc.src.__support.CPP.string_view
86     libc.src.__support.FPUtil.fp_bits
87     libc.src.__support.FPUtil.fenv_impl
88     libc.src.__support.FPUtil.rounding_mode
89     libc.src.__support.common
90     libc.src.__support.libc_assert
91     libc.src.__support.uint
92     libc.src.__support.uint128
93     libc.src.__support.integer_to_string
94     libc.src.__support.float_to_string
98 add_object_library(
99   printf_main
100   SRCS
101     printf_main.cpp
102   HDRS
103     printf_main.h
104   DEPENDS
105     .parser
106     .converter
107     .writer
108     .core_structs
109     libc.src.__support.arg_list
112 if(NOT (TARGET libc.src.__support.File.file) AND LLVM_LIBC_FULL_BUILD)
113   # Not all platforms have a file implementation. If file is unvailable, and a 
114   # full build is requested, then we must skip all file based printf sections.
115   return()
116 endif()
118 add_header_library(
119   vfprintf_internal
120   HDRS
121     vfprintf_internal.h
122   DEPENDS
123     libc.include.stdio
124     libc.src.__support.File.file
125     libc.src.__support.arg_list
126     libc.src.stdio.printf_core.printf_main
127     libc.src.stdio.printf_core.writer
128   ${use_system_file}