@@ -30,11 +30,7 @@ def __init__(self):
30
30
self .build_targets = ['all' ]
31
31
self .ccache = False
32
32
self .check_targets = []
33
- # Removes system dependency on terminfo to keep the dynamic library
34
- # dependencies slim. This can be unconditionally done as it does not
35
- # impact clang's ability to show colors for certain output like
36
- # warnings.
37
- self .cmake_defines = {'LLVM_ENABLE_TERMINFO' : 'OFF' }
33
+ self .cmake_defines = {}
38
34
self .install_targets = []
39
35
self .tools = None
40
36
self .projects = []
@@ -252,6 +248,18 @@ def configure(self):
252
248
self .cmake_defines ['CMAKE_INSTALL_PREFIX' ] = self .folders .install
253
249
254
250
self .cmake_defines ['LLVM_ENABLE_PROJECTS' ] = ';' .join (self .projects )
251
+ # Remove system dependency on terminfo to keep the dynamic library
252
+ # dependencies slim. This can be done unconditionally when the option
253
+ # exists, as it does not impact clang's ability to show colors for
254
+ # certain output like warnings. If the option does not exist, it means
255
+ # that the linked change from clang-19 is present, which basically
256
+ # makes LLVM_ENABLE_TERMINFO=OFF the default, so do not add it in that
257
+ # case to avoid a cmake warning.
258
+ # https://github.com/llvm/llvm-project/commit/6bf450c7a60fa62c642e39836566da94bb9bbc91
259
+ llvm_cmakelists = Path (self .folders .source , 'llvm/CMakeLists.txt' )
260
+ llvm_cmakelists_txt = llvm_cmakelists .read_text (encoding = 'utf-8' )
261
+ if 'LLVM_ENABLE_TERMINFO' in llvm_cmakelists_txt :
262
+ self .cmake_defines ['LLVM_ENABLE_TERMINFO' ] = 'OFF'
255
263
# execinfo.h might not exist (Alpine Linux) but the GWP ASAN library
256
264
# depends on it. Disable the option to avoid breaking the build, the
257
265
# kernel does not depend on it.
0 commit comments