Skip to content

Split run_compiler so users can get the location of the compiler? #716

Description

@jlapeyre

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions