[Openmp-commits] [PATCH] D59451: Fix gettid warnings and one test on FreeBSD

Daphne Pfister via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Apr 5 14:33:44 PDT 2019


daphnediane added inline comments.


================
Comment at: openmp/trunk/cmake/OpenMPTesting.cmake:126
+  # around that, until it is fixed there.
+  if(${CMAKE_THREAD_LIBS_INIT} STREQUAL "-lpthread")
+    set(OPENMP_TEST_COMPILER_THREAD_FLAGS "-pthread")
----------------
Hahnfeld wrote:
> daphnediane wrote:
> > This line is missing quotes and breaks cmake if ${CMAKE_THREAD_LIBS_INIT} is empty see https://bugs.llvm.org/show_bug.cgi?id=41401
> Yes. After consulting the CMake documentation I think the correct way of doing this in CMake is `if(CMAKE_THREAD_LIBS_INIT STREQUAL "-lpthread")` (see https://cmake.org/cmake/help/v3.0/command/if.html for variable evaluation). Can you test if that also works for you?
Tested and it works. That said though that the rest of file uses quoted/prefix "${...}" form with STREQUAL, see lines 137 and 139 below for example. Wasn't sure if consistency was important here. From my own experience with cmake either approach works.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59451





More information about the Openmp-commits mailing list