简体   繁体   中英

cmake libclang with homebrew llvm on macos

I try to build cquery on macos with cquery with llvm(homebrew), but some lib cannot be found.

$ LDFLAGS="-L/usr/local/opt/llvm/lib"  
  CPPFLAGS="-I/usr/local/opt/llvm/include" 
  cmake -DSYSTEM_CLANG=ON  -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++) .

-- The CXX compiler identification is Clang 6.0.0
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using system Clang
CMake Error at /usr/local/Cellar/cmake/3.11.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find Clang (missing: _libclang_LIBRARY _libclang_INCLUDE_DIR)
  (found suitable version "6.0.0", minimum required is "6.0.0")
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.11.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindClang.cmake:93 (find_package_handle_standard_args)
  CMakeLists.txt:91 (find_package)


-- Configuring incomplete, errors occurred!
See also "/Users/vonfry/.local/src/cquery/CMakeFiles/CMakeOutput.log".

根据此页面 ,将CMAKE_PREFIX_PATH用于find_*函数。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM