Andersbakken / rtags

A client/server indexer for c/c++/objc[++] with integration for Emacs based on clang.
http://www.rtags.net
GNU General Public License v3.0
1.83k stars 252 forks source link

Update FindLibClang.cmake to fix a build failure #1439

Open LocutusOfBorg opened 7 months ago

LocutusOfBorg commented 7 months ago

With this regex the example test code of clang fails in cmake, causing an error. this is due to -I/usr/lib/llvm-18/include -std=c++17 -fno-exceptions -funwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DSTDC_CONSTANT_MACROS -DSTDC_FORMAT_MACROS -DSTDC_LIMIT_MACROS becoming: -I/usr/lib/llvm-18/include;-D_GNU_SOURCE;-D_FILE_OFFSET_BITS;-D_LARGEFILE_SOURCE;-D_FILE_OFFSET_BITS;-DSTDC_CONSTANT_MACROS;-DSTDC_FORMAT_MACROS;-DSTDC_LIMIT_MACROS

If you undefine _FILE_OFFSET_BITS and you enable _TIME_BITS=64 you get a FTBFS

/usr/include/features-time64.h:26:5: error: #error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64" 26 | # error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"