Chromium Code Reviews| Index: tools/gn/function_exec_script.cc |
| diff --git a/tools/gn/function_exec_script.cc b/tools/gn/function_exec_script.cc |
| index 540d189069aae8803d5aa2c316637bd7bca0b95c..bf55165ea4f975f7e2e1c5b0887917d89b4b7fae 100644 |
| --- a/tools/gn/function_exec_script.cc |
| +++ b/tools/gn/function_exec_script.cc |
| @@ -348,6 +348,14 @@ Value RunExecScript(Scope* scope, |
| base::FilePath startup_dir = |
| build_settings->GetFullPath(build_settings->build_dir()); |
| + // The first time a build is run, no targets will have been written so the |
| + // build output directory won't exist. We need to make sure it does before |
| + // running any scripts with this as its startup directory, although it will |
| + // be relatively rare that the directory won't exist by the time we get here. |
| + // |
| + // If this shows up on benchmarks, we can cache whether we've done this |
| + // or not and skip creating the directory. |
| + file_util::CreateDirectory(startup_dir); |
|
scottmg
2013/10/24 21:47:20
racing is silently ok on all platforms? (looks ok
|
| // Execute the process. |
| // TODO(brettw) set the environment block. |