File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,15 +38,28 @@ set(UI_H "${CMAKE_CURRENT_BINARY_DIR}/ui.h")
3838if (CMAKE_CROSSCOMPILING )
3939 function (llama_check_host_cxx compiler out_var )
4040 set (src "${CMAKE_CURRENT_BINARY_DIR } /host-cxx-check.cpp" )
41- set (exe "${CMAKE_CURRENT_BINARY_DIR } /host-cxx-check${CMAKE_EXECUTABLE_SUFFIX } " )
41+ if (CMAKE_HOST_WIN32 )
42+ set (exe "${CMAKE_CURRENT_BINARY_DIR } /host-cxx-check.exe" )
43+ else ()
44+ set (exe "${CMAKE_CURRENT_BINARY_DIR } /host-cxx-check" )
45+ endif ()
4246 file (WRITE "${src} " "#include <stdio.h>\n int main() { puts(\" ok\" ); return 0; }\n " )
47+ set (run_rc 1)
4348 execute_process (
4449 COMMAND "${compiler} " -std=c++17 "${src} " -o "${exe} "
4550 RESULT_VARIABLE rc
4651 OUTPUT_QUIET
4752 ERROR_QUIET
4853 )
4954 if (rc EQUAL 0)
55+ execute_process (
56+ COMMAND "${exe} "
57+ RESULT_VARIABLE run_rc
58+ OUTPUT_QUIET
59+ ERROR_QUIET
60+ )
61+ endif ()
62+ if (rc EQUAL 0 AND run_rc EQUAL 0)
5063 set (${out_var} TRUE PARENT_SCOPE )
5164 else ()
5265 set (${out_var} FALSE PARENT_SCOPE )
You can’t perform that action at this time.
0 commit comments