diff options
author | Roman Divacky <rdivacky@freebsd.org> | 2013-05-29 21:09:18 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@freebsd.org> | 2013-05-29 21:09:18 +0000 |
commit | 95ad7794a95e9e0845e680aebab77c5a822802f7 (patch) | |
tree | d0fceea7eb15a129fe8ff6e239d9188e19810dfe /clang/CMakeLists.txt | |
parent | 1bd1927a142089b7c0121102950163df5cc8ba13 (diff) | |
download | llvm-95ad7794a95e9e0845e680aebab77c5a822802f7.zip llvm-95ad7794a95e9e0845e680aebab77c5a822802f7.tar.gz llvm-95ad7794a95e9e0845e680aebab77c5a822802f7.tar.bz2 |
Turn CLANG_ENABLE_{ARCMT,REWRITER,STATIC_ANALYZER} into proper options so that
users can disable those. Just like in autoconf generated makefiles.
llvm-svn: 182881
Diffstat (limited to 'clang/CMakeLists.txt')
-rw-r--r-- | clang/CMakeLists.txt | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index 5d05a4c..faecb0d 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -264,8 +264,27 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ add_definitions( -D_GNU_SOURCE ) -# FIXME: They should be options. -add_definitions(-DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_REWRITER -DCLANG_ENABLE_STATIC_ANALYZER) +option(CLANG_ENABLE_ARCMT "Enable ARCMT by default." ON) +option(CLANG_ENABLE_REWRITER "Enable rewriter by default." ON) +option(CLANG_ENABLE_STATIC_ANALYZER "Enable static analyzer by default." ON) + +if (NOT CLANG_ENABLE_REWRITER AND CLANG_ENABLE_ARCMT) + message(FATAL_ERROR "Cannot disable rewriter while enabling ARCMT") +endif() + +if (NOT CLANG_ENABLE_REWRITER AND CLANG_ENABLE_STATIC_ANALYZER) + message(FATAL_ERROR "Cannot disable rewriter while enabling static analyzer") +endif() + +if(CLANG_ENABLE_ARCMT) + add_definitions(-DCLANG_ENABLE_ARCMT) +endif() +if(CLANG_ENABLE_REWRITER) + add_definitions(-DCLANG_ENABLE_REWRITER) +endif() +if(CLANG_ENABLE_STATIC_ANALYZER) + add_definitions(-DCLANG_ENABLE_STATIC_ANALYZER) +endif() # Clang version information set(CLANG_EXECUTABLE_VERSION |