summaryrefslogtreecommitdiff
path: root/libc/src/__support/HashTable/CMakeLists.txt
blob: d5861e7e825c2e5e502752103387f4bea4ac99a0 (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
add_header_library(
  bitmask
  HDRS
    bitmask.h
  FLAGS
    EXPLICIT_SIMD_OPT
  DEPENDS
    libc.hdr.stdint_proxy
    libc.src.__support.common
    libc.src.__support.CPP.bit
    libc.src.__support.macros.properties.cpu_features
)

list(FIND TARGET_ENTRYPOINT_NAME_LIST getrandom getrandom_index)
if (NOT ${getrandom_index} EQUAL -1)
  message(STATUS "Using getrandom for hashtable randomness")
  set(randomness_compile_flags -DLIBC_HASHTABLE_USE_GETRANDOM)
  set(randomness_extra_depends
    libc.src.__support.OSUtil.linux.getrandom
    libc.hdr.errno_macros)
endif()


add_header_library(
  table
  HDRS
    table.h
  DEPENDS
    .bitmask
    libc.hdr.stdint_proxy
    libc.hdr.types.ENTRY
    libc.src.__support.CPP.bit
    libc.src.__support.CPP.new
    libc.src.__support.hash
    libc.src.__support.macros.attributes
    libc.src.__support.macros.optimization
    libc.src.__support.memory_size
    libc.src.string.memory_utils.inline_strcmp
    libc.src.string.string_utils
)

add_header_library(
  randomness
  HDRS
    randomness.h
  COMPILE_OPTIONS
    ${randomness_compile_flags}
  DEPENDS
    libc.src.__support.hash
    libc.src.__support.common
    ${randomness_extra_depends}
)