2017-09-17 02:47:39 +00:00
|
|
|
function(make_path_run_wrapper cmd target)
|
2019-10-05 02:37:05 +00:00
|
|
|
get_filename_component(name "${target}" NAME)
|
2017-09-17 02:47:39 +00:00
|
|
|
get_filename_component(cmd_resolved "${cmd}" REALPATH)
|
|
|
|
get_filename_component(base_name "${cmd_resolved}" NAME)
|
|
|
|
get_filename_component(dir_name "${cmd_resolved}" DIRECTORY)
|
|
|
|
|
|
|
|
set(source "${target}.c")
|
|
|
|
|
2019-10-05 02:37:05 +00:00
|
|
|
configure_file(src/gcc-wrap.c.in "${source}")
|
2017-09-17 02:47:39 +00:00
|
|
|
|
|
|
|
include(HostCompile)
|
|
|
|
host_compile("${source}" "${target}")
|
2019-10-05 02:37:05 +00:00
|
|
|
|
|
|
|
add_custom_target(generate_${name} DEPENDS "${CMAKE_BINARY_DIR}/${name}")
|
|
|
|
add_dependencies(generate generate_${name})
|
2017-09-17 02:47:39 +00:00
|
|
|
endfunction()
|