[PATCH] D154212: [cmake] Add LLVM_UNITTEST_LINK_FLAGS option

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 30 09:37:59 PDT 2023


phosek added inline comments.


================
Comment at: llvm/cmake/modules/AddLLVM.cmake:1613-1614
 
+  set(LLVM_UNITTEST_LINK_FLAGS "" CACHE STRING
+      "Additional linker flags for unit tests")
+  set_property(TARGET ${test_name} APPEND_STRING PROPERTY
----------------
For variables that are intended to be used by users, I'd prefer to keep them in the top-level `CMakeLists.txt` file for easier discoverability.


================
Comment at: llvm/cmake/modules/AddLLVM.cmake:1615-1616
+      "Additional linker flags for unit tests")
+  set_property(TARGET ${test_name} APPEND_STRING PROPERTY
+               LINK_FLAGS " ${LLVM_UNITTEST_LINK_FLAGS}")
+
----------------
`LINK_FLAGS` property is deprecated and superseded by `LINK_OPTIONS`, see https://cmake.org/cmake/help/latest/prop_tgt/LINK_FLAGS.html. Can you use `target_link_options` instead?


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

https://reviews.llvm.org/D154212



More information about the llvm-commits mailing list