I want to use PackageCompiler for a completely different project that involves compiling C code. It would be useful if I could just find the compiler. You could rewrite run_compiler like this:
function run_compiler(cmd::Cmd; cplusplus::Bool=false)
compiler_cmd = find_compiler_cmd(cplusplus)
full_cmd = `$compiler_cmd $cmd`
@debug "running $full_cmd"
run(full_cmd)
end
And put the rest of the existing function body in find_compiler_cmd instead. Then we could call find_compiler_cmd for other projects.
As it is, we can still just call run_compiler. But, if the function were split as suggested here, we'd have more flexibility, and options for debugging and handling exceptional situations.
This might help resolving #714 . For example, you could call find_compiler_cmd before trying to build your project.
I want to use
PackageCompilerfor a completely different project that involves compiling C code. It would be useful if I could just find the compiler. You could rewriterun_compilerlike this:And put the rest of the existing function body in
find_compiler_cmdinstead. Then we could callfind_compiler_cmdfor other projects.As it is, we can still just call
run_compiler. But, if the function were split as suggested here, we'd have more flexibility, and options for debugging and handling exceptional situations.This might help resolving #714 . For example, you could call
find_compiler_cmdbefore trying to build your project.