[PATCH] D73466: Make unittests include path relative

Sebastian Neubauer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 05:44:38 PST 2020


sebastian-ne created this revision.
sebastian-ne added reviewers: chandlerc, stoklund.
Herald added subscribers: llvm-commits, mgorny.
Herald added a project: LLVM.

This change is relevant when embedding the llvm cmake project into
another project.  It should not change the build behavior of a normal
llvm build.

In the case where llvm is embedded as a cmake subproject,
CMAKE_SOURCE_DIR does not point to the expected directory and building
the tests fails.
Using CMAKE_CURRENT_SOURCE_DIR fixes this problem, as it will always
point to the same directory.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73466

Files:
  llvm/unittests/TableGen/CMakeLists.txt


Index: llvm/unittests/TableGen/CMakeLists.txt
===================================================================
--- llvm/unittests/TableGen/CMakeLists.txt
+++ llvm/unittests/TableGen/CMakeLists.txt
@@ -13,5 +13,5 @@
   CodeExpanderTest.cpp
   AutomataTest.cpp
   )
-include_directories(${CMAKE_SOURCE_DIR}/utils/TableGen)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../utils/TableGen)
 target_link_libraries(TableGenTests PRIVATE LLVMTableGenGlobalISel LLVMTableGen)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73466.240541.patch
Type: text/x-patch
Size: 477 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200127/27e32f99/attachment.bin>


More information about the llvm-commits mailing list