summaryrefslogtreecommitdiff
path: root/libc/src/__support/StringUtil/CMakeLists.txt
blob: 41b20dc2cb1171eca8bc56ceea8e6bd806f4c859 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
add_header_library(
  message_mapper
  HDRS
    message_mapper.h
  DEPENDS
    libc.src.__support.CPP.array
    libc.src.__support.CPP.string_view
    libc.src.__support.CPP.optional
)

# The table maps depend on message_mapper.
add_subdirectory(tables)

add_header_library(
  platform_errors
  HDRS
    platform_errors.h
  DEPENDS
    # To avoid complicated conditionals, we will unconditionally add dependency
    # on all platform errors which are included in platform_error_table.h.
    # Ultimately, only the relevent error table will be used.
    .tables.linux_platform_errors
    .tables.minimal_platform_errors
)

add_header_library(
  platform_signals
  HDRS
    platform_signals.h
  DEPENDS
    # To avoid complicated conditionals, we will unconditionally add dependency
    # on all platform signals which are included in platform_signal_table.h.
    # Ultimately, only the relevent signal table will be used.
    .tables.linux_platform_signals
    .tables.minimal_platform_signals
)

add_object_library(
  error_to_string
  HDRS
    error_to_string.h
  SRCS
    error_to_string.cpp
  DEPENDS
    .message_mapper
    .platform_errors
    libc.src.__support.common
    libc.src.__support.CPP.span
    libc.src.__support.CPP.string_view
    libc.src.__support.CPP.stringstream
    libc.src.__support.integer_to_string
)

if(TARGET libc.include.signal)
  add_object_library(
    signal_to_string
    HDRS
      signal_to_string.h
    SRCS
      signal_to_string.cpp
    DEPENDS
      .message_mapper
      .platform_signals
      libc.include.signal
      libc.src.__support.common
      libc.src.__support.CPP.span
      libc.src.__support.CPP.string_view
      libc.src.__support.CPP.stringstream
      libc.src.__support.integer_to_string
  )
endif()