[PATCH] D104848: [cmake] Handled utils/unittests before projects

Jakub Chlanda via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 29 09:31:29 PDT 2021


jchlanda added a comment.



> This is actually not safe. You're creating a new cached value based on the value of another cached value. Both can be set and updated independently of each other. You should (at least) add a hard error if SYCL_INCLUDE_TESTS=On and LLVM_INCLUDE_TESTS=Off.

That is a good point which will need to be addressed, thank you.

> Why doesn't that work?

When creating sycl executable the dependencies are tracked through `add_dependencies` (https://github.com/intel/llvm/blob/sycl/sycl/cmake/modules/AddSYCLExecutable.cmake#L40) when this line executes with `gtest`set as `<target-dependency>` it (`gtes`) is not a know target, cmake, being cmake is completely happy about it and silently swallows it. When you proceed to building your target the fact that sycl executable does depend on `gtest` is lost, resulting in sycl executable being built ahead of `gtest` and a bunch of linker errors. Pleas do let me know if there is anything else that I could clarify.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104848/new/

https://reviews.llvm.org/D104848



More information about the llvm-commits mailing list