[PATCH] D43278: Add Xray instrumentation support to FreeBSD
David CARLIER via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 14 09:12:41 PST 2018
devnexen added inline comments.
================
Comment at: lib/xray/tests/CMakeLists.txt:28
-lstdc++ -lm ${CMAKE_THREAD_LIBS_INIT}
- -lpthread
- -ldl -lrt)
+ ${CMAKE_DL_LIBS} -lrt)
set_target_properties(XRayUnitTests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
----------------
krytarowski wrote:
> I think this is a broken syntax with ${CMAKE_DL_LIBS}. It evaluates to "" on BSDs but on Linux it will evaluate to "dl" on Haiku to "root be" etc.
>
> Please in newer commits use diff: `-U9999` to help to reviewers to get wider context.
>
> ```
> set(CMAKE_DL_LIBS_INIT "")
> foreach(lib ${CMAKE_DL_LIBS})
> list(APPEND CMAKE_DL_LIBS_INIT -l${lib})
> endforeach()
> ```
>
> And reuse `${CMAKE_DL_LIBS_INIT}` in the place of the current `${CMAKE_DL_LIBS}`.
Nice tip.
https://reviews.llvm.org/D43278
More information about the llvm-commits
mailing list