add_header_library(
  fenv_impl
  HDRS
    FEnvImpl.h
  DEPENDS
    libc.include.fenv
    libc.src.__support.common
    libc.src.__support.compiler_features
)

add_header_library(
  platform_defs
  HDRS
    PlatformDefs.h
  DEPENDS
    libc.src.__support.common
)

add_header_library(
  float_properties
  HDRS
    FloatProperties.h
  DEPENDS
    .platform_defs
    libc.src.__support.uint128
)

add_header_library(
  fp_bits
  HDRS
    FPBits.h
  DEPENDS
    .platform_defs
    .float_properties
    libc.src.__support.builtin_wrappers
    libc.src.__support.CPP.bit
    libc.src.__support.CPP.type_traits
    libc.src.__support.common
)

add_header_library(
  nearest_integer_operations
  HDRS
    NearestIntegerOperations.h
  DEPENDS
    .fp_bits
    .fenv_impl
    libc.src.__support.CPP.type_traits
    libc.src.__support.common
    libc.include.math
    libc.include.errno
    libc.src.errno.errno
)

add_header_library(
  normal_float
  HDRS
    NormalFloat.h
  DEPENDS
    .fp_bits
    libc.src.__support.CPP.type_traits
    libc.src.__support.common
)

add_header_library(
  manipulation_functions
  HDRS
    ManipulationFunctions.h
  DEPENDS
    .fp_bits
    .nearest_integer_operations
    .normal_float
    .platform_defs
    libc.src.__support.CPP.bit
    libc.src.__support.CPP.type_traits
    libc.src.__support.common
    libc.include.math
    libc.include.errno
    libc.src.errno.errno
)

add_header_library(
  basic_operations
  HDRS
    BasicOperations.h
  DEPENDS
    .fp_bits
    libc.src.__support.CPP.type_traits
    libc.src.__support.common
)

add_header_library(
  division_and_remainder_operations
  HDRS
    DivisionAndRemainderOperations.h
  DEPENDS
    .fp_bits
    .manipulation_functions
    .normal_float
    libc.src.__support.CPP.type_traits
    libc.src.__support.common
)

add_header_library(
  except_value_utils
  HDRS
    except_value_utils.h
  DEPENDS
    .fp_bits
    .fenv_impl
    libc.src.__support.CPP.optional
)


add_header_library(
  hypot
  HDRS
    Hypot.h
  DEPENDS
    .basic_operations
    .fenv_impl
    .fp_bits
    libc.src.__support.builtin_wrappers
    libc.src.__support.CPP.bit
    libc.src.__support.CPP.type_traits
    libc.src.__support.common
    libc.src.__support.uint128
)

add_header_library(
  xfloat
  HDRS
    XFloat.h
  DEPENDS
    .fp_bits
    .normal_float
    libc.src.__support.uint
)

add_header_library(
  sqrt
  HDRS
    sqrt.h
  DEPENDS
    libc.src.__support.common
    libc.src.__support.FPUtil.generic.sqrt
)

add_header_library(
  fma
  HDRS
    FMA.h
  DEPENDS
    libc.src.__support.common
    libc.src.__support.CPP.type_traits
    libc.src.__support.FPUtil.generic.fma
  FLAGS
    FMA_OPT
)

add_header_library(
  multiply_add
  HDRS
    multiply_add.h
  DEPENDS
    .fma
)

add_header_library(
  polyeval
  HDRS
    PolyEval.h
  DEPENDS
    .multiply_add
    libc.src.__support.common
)

add_header_library(
  nearest_integer
  HDRS
    nearest_integer.h
  DEPENDS
    libc.src.__support.common
  FLAGS
    ROUND_OPT
)

add_header_library(
  double_double
  HDRS
    double_double.h
  DEPENDS
    libc.src.__support.common
    libc.src.__support.number_pair
    .multiply_add
)

add_header_library(
  dyadic_float
  HDRS
    dyadic_float.h
  DEPENDS
    .float_properties
    .fp_bits
    .multiply_add
    libc.src.__support.common
    libc.src.__support.uint
)

add_subdirectory(generic)
