私はalloca
自分のプロジェクトの 1 つで関数を使用しており、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!
では、示されているコードが関数を見つけたのに、変数を設定していないのはなぜでしょうか? それとも別のものですか?