[PATCH] D73123: [CMake] Fixes for including LLVM into another CMake project

Russell Gallop via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 21 10:20:00 PST 2020


russell.gallop created this revision.
russell.gallop added reviewers: chandlerc, dcoughlin, jroelofs, mgorny, pcc, tstellar, beanz, dsanders.
Herald added subscribers: cfe-commits, Charusso.
Herald added projects: clang, LLVM.

This fixes a couple of paths to allow add_subdirectory(llvm) from a higher level CMake project. Otherwise should be NFC.

Tested by creating a top level CMakeLists.txt in llvm-project:

  cmake_minimum_required(VERSION 3.4.3)
  
  project(my-super-project)
  
  add_subdirectory(llvm)

And pointing cmake at that instead of llvm/CMakeLists.txt.

In this arrangement, most things are built inside an llvm directory inside the build directory. Some tools and files aren't which causes some test fails. This makes things consistent by changing CMAKE_BINARY_DIR to LLVM_BINARY_DIR and CMAKE_SOURCE_DIR to LLVM_SOURCE_DIR.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73123

Files:
  clang/tools/scan-build/CMakeLists.txt
  clang/tools/scan-view/CMakeLists.txt
  clang/utils/hmaptool/CMakeLists.txt
  llvm/tools/llvm-go/CMakeLists.txt
  llvm/tools/llvm-shlib/CMakeLists.txt
  llvm/unittests/TableGen/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73123.239361.patch
Type: text/x-patch
Size: 9049 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200121/c580ebdd/attachment.bin>


More information about the llvm-commits mailing list