[PATCH] [CMake] Pass NO_CMAKE_SYSTEM_PATH to find_library

Akihiko Odaki via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 19 05:42:29 PDT 2016


Searching system path causes to find the host library and could lead to
failure when cross-compiling.
---
 tools/libclang/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt
index 630be12..7e5906a 100644
--- a/tools/libclang/CMakeLists.txt
+++ b/tools/libclang/CMakeLists.txt
@@ -52,7 +52,7 @@ if (TARGET clangTidyPlugin)
   list(APPEND LIBS clangTidyPlugin)
 endif ()
 
-find_library(DL_LIBRARY_PATH dl)
+find_library(DL_LIBRARY_PATH dl NO_CMAKE_SYSTEM_PATH)
 if (DL_LIBRARY_PATH)
   list(APPEND LIBS dl)
 endif()
-- 
2.9.3



More information about the cfe-commits mailing list