Skip to content

Commit 02ccfed

Browse files
committed
Add CMake option for the rewriter
1 parent f7e547f commit 02ccfed

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

clang/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,11 +432,18 @@ if(NOT LLVM_STATIC_LINK_CXX_STDLIB)
432432
set(HAVE_CLANG_REPL_SUPPORT ON)
433433
endif()
434434

435+
option(CLANG_ENABLE_OBJC_REWRITER "Build the Objective-C rewriter tool" OFF)
436+
435437
option(CLANG_ENABLE_STATIC_ANALYZER
436438
"Include static analyzer in clang binary." ON)
437439

438440
option(CLANG_ENABLE_PROTO_FUZZER "Build Clang protobuf fuzzer." OFF)
439441

442+
if (DEFINED CLANG_ENABLE_ARCMT)
443+
set(CLANG_ENABLE_OBJC_REWRITER ${CLANG_ENABLE_ARCMT})
444+
message(DEPRECATION "'CLANG_ENABLE_ARCMT' is deprecated as ARCMigrate has been removed from Clang. Please use 'CLANG_ENABLE_OBJC_REWRITER' instead to enable or disable the Objective-C rewriter.")
445+
endif()
446+
440447
# This option is a stop-gap, we should commit to removing this as
441448
# soon as possible. See discussion:
442449
# https://discourse.llvm.org/t/rationale-for-removing-versioned-libclang-middle-ground-to-keep-it-behind-option/

clang/test/Rewriter/lit.local.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# The Objective-C rewriters are currently grouped with ARCMT.
2-
config.unsupported = True
2+
if not config.root.clang_objc_rewriter:
3+
config.unsupported = True

clang/test/lit.site.cfg.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ config.host_cxx = "@CMAKE_CXX_COMPILER@"
2222
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
2323
config.have_zlib = @LLVM_ENABLE_ZLIB@
2424
config.have_zstd = @LLVM_ENABLE_ZSTD@
25+
config.clang_objc_rewriter = "@CLANG_ENABLE_OBJC_REWRITER@" == "ON"
2526
config.clang_default_pie_on_linux = @CLANG_DEFAULT_PIE_ON_LINUX@
2627
config.clang_default_cxx_stdlib = "@CLANG_DEFAULT_CXX_STDLIB@"
2728
config.clang_staticanalyzer = @CLANG_ENABLE_STATIC_ANALYZER@

0 commit comments

Comments
 (0)