我在我的alloca
一个项目中使用该功能,并决定使用 CMake 来确保它可用。所以我将这一点添加到我的 CMakeLists.txt 文件中:
include(CheckSymbolExists)
check_symbol_exists(alloca stdlib.h;cstdlib ALLOCA_EXISTS)
if (NOT ALLOCA_EXISTS)
message(FATAL_ERROR "Platform does not support alloca")
endif ()
当我运行 CMake 时,这是输出的(相关部分):
-- Looking for alloca
-- Looking for alloca - found
CMake Error at CMakeLists.txt:11 (message):
Platform does not support alloca
-- Configuring incomplete, errors occurred!
那么显示的代码如何找到函数但没有设置变量?或者是别的什么?