[libc-commits] [PATCH] D101609: [libc] warns about missing linting only in full build mode

Guillaume Chatelet via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon May 3 01:38:22 PDT 2021


gchatelet updated this revision to Diff 342329.
gchatelet added a comment.

- Add error when linting is ON but full build is disabled.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101609/new/

https://reviews.llvm.org/D101609

Files:
  libc/CMakeLists.txt


Index: libc/CMakeLists.txt
===================================================================
--- libc/CMakeLists.txt
+++ libc/CMakeLists.txt
@@ -42,7 +42,12 @@
                   --print-resource-dir not supported by host compiler")
 endif()
 
+option(LLVM_LIBC_FULL_BUILD "Build and test LLVM libc as if it is the full libc" OFF)
+
 option(LLVM_LIBC_ENABLE_LINTING "Enables linting of libc source files" OFF)
+if(LLVM_LIBC_ENABLE_LINTING AND (NOT LLVM_LIBC_FULL_BUILD))
+  message(FATAL_ERROR "Cannot enable linting when full libc build is not enabled.")
+endif()
 if(LLVM_LIBC_ENABLE_LINTING)
   if("clang-tools-extra" IN_LIST LLVM_ENABLE_PROJECTS
              AND "clang" IN_LIST LLVM_ENABLE_PROJECTS)
@@ -56,7 +61,7 @@
       To disable linting set LLVM_LIBC_ENABLE_LINTING to OFF
       (pass -DLLVM_LIBC_ENABLE_LINTING=OFF to cmake).")
   endif()
-else()
+elseif(LLVM_LIBC_FULL_BUILD)
   message(WARNING "
     Linting for libc is currently disabled.
 
@@ -64,8 +69,6 @@
     (pass -DLLVM_LIBC_ENABLE_LINTING=ON to cmake).")
 endif()
 
-option(LLVM_LIBC_FULL_BUILD "Build and test LLVM libc as if it is the full libc" OFF)
-
 include(CMakeParseArguments)
 include(LLVMLibCRules)
 include(LLVMLibCCheckCpuFeatures)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101609.342329.patch
Type: text/x-patch
Size: 1223 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20210503/8039387b/attachment.bin>


More information about the libc-commits mailing list