什么是“执行测试CMAKE_HAVE_LIBC_PTHREAD"?失败实际上是什么意思? [英] What does "Performing Test CMAKE_HAVE_LIBC_PTHREAD" failed actually mean?
问题描述
cmake的部分输出如下所示:
The cmake partial output looks like this:
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
推荐答案
线条
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
是类似呼叫的输出
find_package(Threads)
许多要使用线程相关功能(例如 pthread_create
)的CMake项目在脚本 CMakeLists.txt
中使用了此调用.
This call is used in a script CMakeLists.txt
by many CMake projects which want to use threads-related functionality (like pthread_create
).
处理此调用时,CMake(通过 FindThreads.cmake 脚本)尝试确定当前平台的线程支持的种类.
When process this call, CMake (by means of FindThreads.cmake script) tries to determine kind of thread support for the current platform.
检查寻找pthread.h
是不言自明的:CMake检查标头 pthread.h
是否存在并且可用.
The check Looking for pthread.h
is self-explanatory: CMake checks whether header pthread.h
exists and available.
检查性能测试CMAKE_HAVE_LIBC_PTHREAD
是关于线程支持功能是直接编译到libc库中,还是需要链接其他库(如 -lpthread
).
The check Performing Test CMAKE_HAVE_LIBC_PTHREAD
is about whether thread support functions are compiled into libc library directly, or one need to link additional libraries (like -lpthread
).
检查在pthreads中查找pthread_create
会尝试在其中找到 pthreads
库并在其中查找功能 pthread_create
.
The check Looking for pthread_create in pthreads
tries to find pthreads
library and function pthread_create
in it.
检查在pthread中查找pthread_create
试图在其中找到 pthread
库和函数 pthread_create
.
The check Looking for pthread_create in pthread
tries to find pthread
library and function pthread_create
in it.
该特定输出可以解释为:
That particular output could be interpreted as:
平台通过提供标头
pthread.h
和库pthread
来支持线程.
此输出对于类似Unix的系统是常见的.尽管失败",和未找到"话说来,这是非常好的输出.
This output is common for Unix-like systems. Despite "Failed" and "not found" words, this is perfectly good output.
这篇关于什么是“执行测试CMAKE_HAVE_LIBC_PTHREAD"?失败实际上是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!