[PATCH] D33299: [Polly][CMake] Use the CMake Package instead of llvm-config in out-of-tree builds

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 19 07:32:55 PDT 2017


Meinersbur added a comment.

Can you rebase to current trunk? I'd like to try out by myself.

Are some of the condition the result of using the LLVMConfig.cmake from and install_prefix or build directory?



================
Comment at: CMakeLists.txt:24
+  if (LLVM_BUILD_MAIN_SRC_DIR)
+    set(LLVM_SOURCE_ROOT ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
+  else()
----------------
This is the same line in both cases?


================
Comment at: CMakeLists.txt:26
+  else()
+    execute_process(COMMAND "${LLVM_INSTALL_ROOT}/bin/llvm-config" --src-root
+      OUTPUT_VARIABLE MAIN_SRC_DIR
----------------
Still using `llvm-config`? If there is no `LLVM_BUILD_MAIN_SRC_DIR`, shouldn't the llvm-config also fail?


================
Comment at: CMakeLists.txt:35
   if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h)
-    add_library(gtest
-      ${UNITTEST_DIR}/googletest/src/gtest-all.cc
-      ${UNITTEST_DIR}/googlemock/src/gmock-all.cc
-    )
-    target_include_directories(gtest
-      PUBLIC
-      "${UNITTEST_DIR}/googletest/include"
-      "${UNITTEST_DIR}/googlemock/include"
-
-      PRIVATE
-      "${UNITTEST_DIR}/googletest"
-      "${UNITTEST_DIR}/googlemock"
-    )
-    target_link_libraries(gtest -lpthread)
-
-    add_library(gtest_main ${UNITTEST_DIR}/UnitTestMain/TestMain.cpp)
-    target_link_libraries(gtest_main gtest)
-
-    set(POLLY_GTEST_AVAIL 1)
+    if (TARGET gtest)
+      set_target_properties(gtest
----------------
Under which conditions does LLVM not export a gtest target?


================
Comment at: lib/CMakeLists.txt:109
+    LLVMPasses
+    ${nvptx_libs}
+    # The libraries below are required for darwin: http://PR26392
----------------
Has this order change a reason?

You seem to have added `LLVMPasses` to your local changes.


https://reviews.llvm.org/D33299





More information about the llvm-commits mailing list