[llvm] e5eeb84 - Make unittests include path relative

Sebastian Neubauer via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 21 01:19:20 PST 2020


Author: Sebastian Neubauer
Date: 2020-02-21T10:19:11+01:00
New Revision: e5eeb8465f29bf4e9cf6f1edb88573338fc12725

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

LOG: Make unittests include path relative

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.

Differential Revision: https://reviews.llvm.org/D73466

Added: 
    

Modified: 
    llvm/unittests/TableGen/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/TableGen/CMakeLists.txt b/llvm/unittests/TableGen/CMakeLists.txt
index 328ba56691d7..178018ba8967 100644
--- a/llvm/unittests/TableGen/CMakeLists.txt
+++ b/llvm/unittests/TableGen/CMakeLists.txt
@@ -13,5 +13,5 @@ add_llvm_unittest(TableGenTests
   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)


        


More information about the llvm-commits mailing list