]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #11155 : SiegeLord/rust/early_deps, r=pcwalton
authorbors <bors@rust-lang.org>
Tue, 31 Dec 2013 20:37:17 +0000 (12:37 -0800)
committerbors <bors@rust-lang.org>
Tue, 31 Dec 2013 20:37:17 +0000 (12:37 -0800)
The `--dep-info` command line option allows a nice way to generate make-style dependencies, but it currently does so alongside building of the output binary. This isn't a problem for make, as it mixes dependency graph generation and actual building, but it is problematic for other tools (e.g. CMake) which keep them separate.

To play more nicely with those tools, I've moved the --dep-info output from phase 6 (linking) up to after phase 2 (expansion of macros). Also, since there was no prior option to do so, I added a command line switch (`--no-analysis`) to stop compilation just before phase 3 (type-checking) which speeds this up even further.

Here's the beginning of a CMake function which is enabled by this change:

~~~cmake
function(get_rust_deps root_file out_var)
execute_process(COMMAND rustc ${RUSTC_FLAGS} --no-analysis --dep-info "${CMAKE_BINARY_DIR}/.deps" "${root_file}")

# Read and parse the dependency information
file(READ "${CMAKE_BINARY_DIR}/.deps" crate_deps)
file(REMOVE "${CMAKE_BINARY_DIR}/.deps")
# parsing follows...
~~~


Trivial merge