zig/cmake/install.cmake
Andrew Kelley 7eb0a3edce
remove libc dependency of zig0 building libstage2
Rather than `zig0 build ...` the build now does
`zig0 build-lib ...`, avoiding the requirement of linking the build
script, and thus avoiding the requirement of finding native libc,
for systems where libc is the system ABI.
2020-02-16 18:57:34 -05:00

37 lines
988 B
CMake

message("-- Installing: ${CMAKE_INSTALL_PREFIX}/lib")
if(NOT EXISTS ${zig_EXE})
message("::")
message(":: ERROR: Executable not found")
message(":: (execute_process)")
message("::")
message(":: executable: ${zig_EXE}")
message("::")
message(FATAL_ERROR)
endif()
execute_process(COMMAND ${zig_EXE} ${ZIG_INSTALL_ARGS}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE _result
)
if(_result)
message("::")
message(":: ERROR: ${_result}")
message(":: (execute_process)")
string(REPLACE ";" " " s_INSTALL_LIBUSERLAND_ARGS "${ZIG_INSTALL_ARGS}")
message("::")
message(":: argv: ${zig_EXE} ${s_INSTALL_LIBUSERLAND_ARGS}")
set(_args ${zig_EXE} ${ZIG_INSTALL_ARGS})
list(LENGTH _args _len)
math(EXPR _len "${_len} - 1")
message("::")
foreach(_i RANGE 0 ${_len})
list(GET _args ${_i} _arg)
message(":: argv[${_i}]: ${_arg}")
endforeach()
message("::")
message(FATAL_ERROR)
endif()