xref: /llvm-project/libc/src/__support/StringUtil/CMakeLists.txt (revision 38228d5efe18cbe45ea02ebb08b2d2a7e4b68560)
1add_header_library(
2  message_mapper
3  HDRS
4    message_mapper.h
5  DEPENDS
6    libc.src.__support.CPP.array
7    libc.src.__support.CPP.string_view
8    libc.src.__support.CPP.optional
9)
10
11# The table maps depend on message_mapper.
12add_subdirectory(tables)
13
14add_header_library(
15  platform_errors
16  HDRS
17    platform_errors.h
18  DEPENDS
19    # To avoid complicated conditionals, we will unconditionally add dependency
20    # on all platform errors which are included in platform_error_table.h.
21    # Ultimately, only the relevent error table will be used.
22    .tables.linux_platform_errors
23    .tables.minimal_platform_errors
24)
25
26add_header_library(
27  platform_signals
28  HDRS
29    platform_signals.h
30  DEPENDS
31    # To avoid complicated conditionals, we will unconditionally add dependency
32    # on all platform signals which are included in platform_signal_table.h.
33    # Ultimately, only the relevent signal table will be used.
34    .tables.linux_platform_signals
35    .tables.minimal_platform_signals
36)
37
38add_object_library(
39  error_to_string
40  HDRS
41    error_to_string.h
42  SRCS
43    error_to_string.cpp
44  DEPENDS
45    .message_mapper
46    .platform_errors
47    libc.src.__support.common
48    libc.src.__support.CPP.span
49    libc.src.__support.CPP.string_view
50    libc.src.__support.CPP.stringstream
51    libc.src.__support.integer_to_string
52)
53
54if(TARGET libc.include.signal)
55  add_object_library(
56    signal_to_string
57    HDRS
58      signal_to_string.h
59    SRCS
60      signal_to_string.cpp
61    DEPENDS
62      .message_mapper
63      .platform_signals
64      libc.include.signal
65      libc.src.__support.common
66      libc.src.__support.CPP.span
67      libc.src.__support.CPP.string_view
68      libc.src.__support.CPP.stringstream
69      libc.src.__support.integer_to_string
70  )
71endif()
72