[libc-commits] [libc] b622a25 - [libc][Obvious] Use full path with cmake's if(EXISTS ...).

Siva Chandra Reddy via libc-commits libc-commits at lists.llvm.org
Wed Jun 10 15:18:12 PDT 2020


Author: Siva Chandra Reddy
Date: 2020-06-10T15:08:00-07:00
New Revision: b622a255a36825b774a40ee02dc0ec44dea2987f

URL: https://github.com/llvm/llvm-project/commit/b622a255a36825b774a40ee02dc0ec44dea2987f
DIFF: https://github.com/llvm/llvm-project/commit/b622a255a36825b774a40ee02dc0ec44dea2987f.diff

LOG: [libc][Obvious] Use full path with cmake's if(EXISTS ...).

That if(EXISTS ...) works only with full paths was missed in couple of
places a in recent cleanup.

Added: 
    

Modified: 
    libc/src/string/CMakeLists.txt
    libc/test/config/linux/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libc/src/string/CMakeLists.txt b/libc/src/string/CMakeLists.txt
index 114fce7d626d..47c34f174f11 100644
--- a/libc/src/string/CMakeLists.txt
+++ b/libc/src/string/CMakeLists.txt
@@ -132,6 +132,6 @@ add_bzero(bzero MARCH native)
 # Add all other relevant implementations for the native target.
 # ------------------------------------------------------------------------------
 
-if(EXISTS ${LIBC_STRING_TARGET_ARCH})
+if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_STRING_TARGET_ARCH})
   include(${LIBC_STRING_TARGET_ARCH}/CMakeLists.txt)
 endif()

diff  --git a/libc/test/config/linux/CMakeLists.txt b/libc/test/config/linux/CMakeLists.txt
index caff2ef86e24..fea3d0b2dcbe 100644
--- a/libc/test/config/linux/CMakeLists.txt
+++ b/libc/test/config/linux/CMakeLists.txt
@@ -1,5 +1,5 @@
 add_libc_testsuite(libc_linux_tests)
 
-if(EXISTS ${LIBC_TARGET_MACHINE})
+if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_MACHINE})
   add_subdirectory(${LIBC_TARGET_MACHINE})
 endif()


        


More information about the libc-commits mailing list