diff --git a/llvm/cmake/modules/FindTerminfo.cmake b/llvm/cmake/modules/FindTerminfo.cmake --- a/llvm/cmake/modules/FindTerminfo.cmake +++ b/llvm/cmake/modules/FindTerminfo.cmake @@ -15,11 +15,11 @@ if(Terminfo_LIBRARIES) include(CMakePushCheckState) - include(CheckCSourceCompiles) + include(CheckCXXSourceCompiles) cmake_push_check_state() list(APPEND CMAKE_REQUIRED_LIBRARIES ${Terminfo_LIBRARIES}) - check_c_source_compiles(" - int setupterm(char *term, int filedes, int *errret); + check_cxx_source_compiles(" + extern \"C\" { int setupterm(char *term, int filedes, int *errret); } int main() { return setupterm(0, 0, 0); }" Terminfo_LINKABLE) cmake_pop_check_state()