[llvm] [CMake] Support per-target linker flags (PR #68393)

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 18 00:44:31 PDT 2023


================
@@ -1524,6 +1528,13 @@ macro(add_llvm_tool_subdirectory name)
   add_llvm_external_project(${name})
 endmacro(add_llvm_tool_subdirectory)
 
+macro(add_custom_linker_flags name)
+  if (LLVM_${name}_LINKER_FLAGS)
+    message(STATUS "Applying ${LLVM_${name}_LINKER_FLAGS} to ${name}")
----------------
petrhosek wrote:

An alternative to an option would be to use the `DEBUG` mode instead of `STATUS` so developers can use [`CMAKE_MESSAGE_LOG_LEVEL`](https://cmake.org/cmake/help/latest/variable/CMAKE_MESSAGE_LOG_LEVEL.html#variable:CMAKE_MESSAGE_LOG_LEVEL) to suppress the output if desired.

https://github.com/llvm/llvm-project/pull/68393


More information about the llvm-commits mailing list