Files
cleonos/cmake/check_tools.cmake

41 lines
1.0 KiB
CMake
Raw Permalink Normal View History

2026-04-11 13:50:38 +08:00
cmake_minimum_required(VERSION 3.20)
include("${CMAKE_CURRENT_LIST_DIR}/log.cmake")
function(require_tool TOOL_VALUE)
if("${TOOL_VALUE}" STREQUAL "")
cl_log_error("missing tool name")
endif()
if(IS_ABSOLUTE "${TOOL_VALUE}")
if(NOT EXISTS "${TOOL_VALUE}")
cl_log_error("missing tool: ${TOOL_VALUE}")
endif()
return()
endif()
find_program(_tool_path NAMES "${TOOL_VALUE}")
if(NOT _tool_path)
cl_log_error("missing tool: ${TOOL_VALUE}")
endif()
endfunction()
cl_log_step("checking host tools")
require_tool("${GIT_TOOL}")
require_tool("${TAR_TOOL}")
require_tool("${XORRISO_TOOL}")
require_tool("${CC_TOOL}")
require_tool("${LD_TOOL}")
require_tool("${OBJCOPY_TOOL}")
require_tool("${OBJDUMP_TOOL}")
require_tool("${READELF_TOOL}")
2026-04-17 18:26:39 +08:00
require_tool("${NM_TOOL}")
2026-04-17 19:17:03 +08:00
require_tool("${ADDR2LINE_TOOL}")
2026-04-11 13:50:38 +08:00
require_tool("${USER_CC_TOOL}")
require_tool("${USER_LD_TOOL}")
require_tool("${RUSTC_TOOL}")
require_tool("${MAKE_TOOL}")
require_tool("${SH_TOOL}")
2026-04-17 18:26:39 +08:00
cl_log_info("required tools are available")