xref: /llvm-project/libc/src/__support/HashTable/CMakeLists.txt (revision 69c0b2febe01108f50db6e8ed21cd8b2e6088caf)
1add_header_library(
2  bitmask
3  HDRS
4    bitmask.h
5  FLAGS
6    EXPLICIT_SIMD_OPT
7  DEPENDS
8    libc.src.__support.common
9    libc.src.__support.CPP.bit
10    libc.src.__support.macros.properties.cpu_features
11)
12
13list(FIND TARGET_ENTRYPOINT_NAME_LIST getrandom getrandom_index)
14if (NOT ${getrandom_index} EQUAL -1)
15  message(STATUS "Using getrandom for hashtable randomness")
16  set(randomness_compile_flags -DLIBC_HASHTABLE_USE_GETRANDOM)
17  set(randomness_extra_depends
18    libc.src.sys.random.getrandom libc.src.errno.errno)
19endif()
20
21
22add_header_library(
23  table
24  HDRS
25    table.h
26  DEPENDS
27    .bitmask
28    libc.include.llvm-libc-types.ENTRY
29    libc.src.__support.CPP.bit
30    libc.src.__support.CPP.new
31    libc.src.__support.hash
32    libc.src.__support.macros.attributes
33    libc.src.__support.macros.optimization
34    libc.src.__support.memory_size
35    libc.src.string.memset
36    libc.src.string.strcmp
37    libc.src.string.strlen
38)
39
40add_header_library(
41  randomness
42  HDRS
43    randomness.h
44  COMPILE_OPTIONS
45    ${randomness_compile_flags}
46  DEPENDS
47    libc.src.__support.hash
48    libc.src.__support.common
49    ${randomness_extra_depends}
50)
51