Skip to content

Commit b3c34ca

Browse files
committed
tc_build/llvm: Handle the deprecation of CLANG_ENABLE_ARCMT
The CLANG_ENABLE_ARCMT option was deprecated in commit [1] due to the removal of ARCMigrate. So check if the option exists before disabling it to avoid cmake warnings. [1]: llvm/llvm-project@c4a0197 Signed-off-by: Dakkshesh <[email protected]>
1 parent bf26a9a commit b3c34ca

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Diff for: tc_build/llvm.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,6 @@ class LLVMSlimBuilder(LLVMBuilder):
397397
def configure(self):
398398
# yapf: disable
399399
slim_clang_defines = {
400-
# Objective-C Automatic Reference Counting (we don't use Objective-C)
401-
# https://clang.llvm.org/docs/AutomaticReferenceCounting.html
402-
'CLANG_ENABLE_ARCMT': 'OFF',
403400
# We don't (currently) use the static analyzer and it saves cycles
404401
# according to Chromium OS:
405402
# https://crrev.com/44702077cc9b5185fc21e99485ee4f0507722f82
@@ -409,6 +406,16 @@ def configure(self):
409406
'CLANG_PLUGIN_SUPPORT': 'OFF',
410407
}
411408

409+
# Objective-C Automatic Reference Counting (we don't use Objective-C)
410+
# https://clang.llvm.org/docs/AutomaticReferenceCounting.html
411+
# Disable this option only if it exists to prevent CMake warnings.
412+
# CLANG_ENABLE_ARCMT was deprecated in favor of CLANG_ENABLE_OBJC_REWRITER,
413+
# which is disabled by default.
414+
# https://github.com/llvm/llvm-project/commit/c4a019747c98ad9326a675d3cb5a70311ba170a2
415+
arcmt_cmakelists = Path(self.folders.source, 'clang/lib/ARCMigrate/CMakeLists.txt')
416+
if arcmt_cmakelists.exists():
417+
slim_clang_defines['CLANG_ENABLE_ARCMT'] = 'OFF'
418+
412419
llvm_build_runtime = self.cmake_defines.get('LLVM_BUILD_RUNTIME', 'ON') == 'ON'
413420
build_compiler_rt = self.project_is_enabled('compiler-rt') and llvm_build_runtime
414421

0 commit comments

Comments
 (0)