mirror of
https://github.com/matrix-construct/construct
synced 2024-05-19 19:33:45 +02:00
ircd::gpt::pipe::code: Simplify source construction.
This commit is contained in:
parent
601a7a3a6a
commit
571271c6a6
|
@ -205,43 +205,18 @@ ircd::gpt::pipe::code::from_source(const string_view &comp_opts,
|
||||||
if(!code_path)
|
if(!code_path)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
if(!fs::is_reg(code_path))
|
|
||||||
return {};
|
|
||||||
|
|
||||||
const fs::fd fd
|
|
||||||
{
|
|
||||||
code_path
|
|
||||||
};
|
|
||||||
|
|
||||||
const std::string read
|
|
||||||
{
|
|
||||||
fs::read(fd)
|
|
||||||
};
|
|
||||||
|
|
||||||
const string_view src
|
|
||||||
{
|
|
||||||
read
|
|
||||||
};
|
|
||||||
|
|
||||||
const vector_view<const string_view> srcs
|
|
||||||
(
|
|
||||||
&src, 1
|
|
||||||
);
|
|
||||||
|
|
||||||
char pbuf[1][48];
|
|
||||||
log::logf
|
log::logf
|
||||||
{
|
{
|
||||||
log, log::level::DEBUG,
|
log, log::level::DEBUG,
|
||||||
"source code `%s' %s comp_opts:%zu link_opts:%zu attempting...",
|
"source code `%s'comp_opts:%zu link_opts:%zu attempting...",
|
||||||
code_path,
|
code_path,
|
||||||
pretty(pbuf[0], si(size(read))),
|
|
||||||
size(comp_opts),
|
size(comp_opts),
|
||||||
size(link_opts),
|
size(link_opts),
|
||||||
};
|
};
|
||||||
|
|
||||||
cl::code ret
|
cl::code ret
|
||||||
{
|
{
|
||||||
srcs
|
cl::code::path, code_path
|
||||||
};
|
};
|
||||||
|
|
||||||
ret.compile(comp_opts);
|
ret.compile(comp_opts);
|
||||||
|
|
Loading…
Reference in a new issue