Skip to content

[libc] need a better way to handle PREFER_GENERIC #79474

@SchrodingerZhu

Description

@SchrodingerZhu

We use PREFER_GENERIC to flag some targets such that we can test objects compiled without even SSE2 support. However, due to the limitation of current cmake setup, this means that -D__LIBC_PREFER_GENERIC will be added to the default builds to those objects, which is quite unfortunate.

We need to have an approach similar to the following:

add_header_library(
  bitmask
  HDRS
    bitmask.h
  FLAGS
    PREFER_GENERIC=0
  DEPENDS
    libc.src.__support.common
    libc.src.__support.CPP.bit
    libc.src.__support.macros.properties.cpu_features
)

in which we can specify the default value of a flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cmakeBuild system in general and CMake in particularlibc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions