[libc] Do not add unittests if LLVM_INCLUDE_TESTS is OFF.
authorSiva Chandra <sivachandra@google.com>
Tue, 15 Oct 2019 17:42:28 +0000 (17:42 +0000)
committerSiva Chandra <sivachandra@google.com>
Tue, 15 Oct 2019 17:42:28 +0000 (17:42 +0000)
Reviewers: nathanchance

Subscribers: mgorny, tschuett, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D68726

llvm-svn: 374925

libc/cmake/modules/LLVMLibCRules.cmake

index ea43e51..026cd38 100644 (file)
@@ -220,6 +220,10 @@ function(add_entrypoint_library target_name)
 endfunction(add_entrypoint_library)
 
 function(add_libc_unittest target_name)
+  if(NOT LLVM_INCLUDE_TESTS)
+    return()
+  endif()
+
   cmake_parse_arguments(
     "LIBC_UNITTEST"
     "" # No optional arguments