<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/79474>79474</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc] need a better way to handle `PREFER_GENERIC`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
SchrodingerZhu
</td>
</tr>
</table>
<pre>
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 `-fno-sse2` will be added to the default builds to those objects, which is quite unfortunate.
We need to have an approach to such as
```cmake
add_header_library(
bitmask
HDRS
bitmask.h
FLAGS
PREFER_GENERIC=false
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.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0U8GOozgQ_RpzKTUCJ5DOgUNvJ5lZaTVqdR9G2ktk7CL2jsGsq5wof78Cws7uaEZCIFeVXxXvvVJE7jIgNqL6TVSHTCW2ITYf2sZg3HDB-KdNWRvMvfmKkAhB1MXb-_F0fD9_On45vv_-KuoCOEDn1QUo9Ais4gWZgJK2wFYx3BC0GoCRGEL7F2om0KEfnUcDN8c2JAa84jChf3wc5YRJaRxD5Bw-hxteMQr5Cibh1Istgne9Y8UuDBA60ClGHBh0r74hEHIap3q2jqBHNdAyiKiLp24IT0Q497g576FFUMagWZENdip5hjY5b2iJBsJ18gn3Zp224Aj-To4R0tCFyGlQjDmI4iCKl-X9FWHABdmqK4IaQI1jDGpiJiwMKXrcqIvlmf9hiSljzhaVwXj2ro0q3oV8XlIAreNe0bfH8fPh_WPN_JvL7Ro6_fHy6T_5HyTcHDrlCdf84fh2_HJYy71rdU5R5-fzqokOfR-G73A_KXl9e8tbx7_G6JWOgfIxhhEjO6Rcj-ncoeIUceVE7n8gZzm64SHBw1k0onbd_X_yXZVPOHlDzd7MM9NszH6zVxk25a6oZbF5lmVmm21lSi11-fxcFlVdGtybGjdmV5q2a0ujM9fIQm6LUlblblOUMjeyrKt6V-2MLFsjN2JbYK-cz72_9nmIl8wRJWx2--1um3nVoqd5w6SciBBSTrsWm6n8qU0XEtvCO2L6DsCO_byV84XqsPhIQYvMGOGm7oupBuN_vpNZir6xzCOJzYuQJyFPF8c2tZN4Qp6mTo_P0xjDZG0hT_PcJORpHv2fAAAA__-Bu1Fc">