Commit a61d253
committed
[Clang][CMake] respect LLVMConfig.cmake's LLVM_DEFINITIONS
In llvm#138329, _GNU_SOURCE was added for Cygwin, but when building Clang
standalone against an installed LLVM this definition was not picked up,
resulting in undefined strnlen. Follow the documentation in
https://llvm.org/docs/CMake.html#developing-llvm-passes-out-of-source
and add the LLVM_DEFINITIONS in Clang's CMakeLists.txt.
Get rid of the list(REMOVE CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
later, as list(REMOVE) is documented to remove *all* occurences of the
item, not just the one that was just added. Instead, make use of
cmake_push_check_state() and cmake_pop_check_state(), which is already
used in other cmake files.1 parent deec7fb commit a61d253
1 file changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
| |||
183 | 187 | | |
184 | 188 | | |
185 | 189 | | |
| 190 | + | |
186 | 191 | | |
187 | 192 | | |
188 | 193 | | |
| 194 | + | |
189 | 195 | | |
190 | 196 | | |
191 | 197 | | |
192 | 198 | | |
193 | 199 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
| 200 | + | |
198 | 201 | | |
199 | 202 | | |
200 | 203 | | |
| |||
0 commit comments