On 2014/05/27 15:36:59, jochen wrote:
is script = "mksnapshot" enough to make gn build mksnapshot first? And does it
figure out itself that it needs to build mksnapshot for the host arch?

No and no.

To make it build mksnapshot for the host arch before running the action, do:
  deps = [ ":mksnapshot($host_toolchain)" ]

just writing script = "foo" will look in the current dir for "foo", which is not
what you want. Albert has some stuff to make it easier to run generated
binaries, but this isn't quite ready yet. In the meantime, you'll need to write
a python script to run the binary. A bit annoying but not hard:

The host binary will go into a directory that depends on the host arch and also
whether that's the same as the target arch. To get the output dir name do:
get_label_info(":mksnapshot($host_toolchain)", "root_out_dir") which will return
something like "//out/Default" or "//out/Default/x64". The run that through
rebase_path to make it relative to the build dir.

So assuming your Python script takes the binary name as the first param and the
args to the binary as the following ones, do
  args = [ "./" + rebase_path(get_label_info(":mksnapshot($host_toolchain)",
"root_out_dir") + "/mksnapshot"), "root_build_dir"), <other args here> ]

Hope that makes sense, it's currently a bit more complicated than I'd like.
(The "./" at the beginning is to prevent it from finding other "mksnapshot"
binaries that might be on the path).

https://codereview.chromium.org/293363009/

--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to