[libc-commits] [libc] [libc][cmake] reset COMPILE_DEFINITIONS (PR #77810)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Thu Jan 11 11:28:08 PST 2024


nickdesaulniers wrote:

> I would guess that the debug macro is being set based on the cmake flag -DCMAKE_BUILD_TYPE=Debug, and we might want to respect that in our build. Other than that this looks fine to me.

I just tested that hypothesis by configuring with `-DCMAKE_BUILD_TYPE=Release` (and clearing the cmake cache). You're right; the list of preprocessor defines changes to:

- _GNU_SOURCE
- _FILE_OFFSET_BITS=64
- _LARGEFILE_SOURCE_FILE_OFFSET_BITS=64
- __STDC_CONSTANT_MACROS
- __STDC_FORMAT_MACROS
- __STDC_LIMIT_MACROS

So I think it makes sense to:
1. clear everything
2. re-set _DEBUG if necessary.

I'll add 2.

https://github.com/llvm/llvm-project/pull/77810


More information about the libc-commits mailing list