From 19c4f9b355d2cabf8b781d70178f1689ade3214b Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Wed, 14 Mar 2012 23:01:01 +0100 Subject: buildtool: don't create build output folders in parallel. superfast in series, so no need, and bugs in parallel. (bzr r11088) --- buildtool.cpp | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'buildtool.cpp') diff --git a/buildtool.cpp b/buildtool.cpp index bc04d6815..a106f206d 100644 --- a/buildtool.cpp +++ b/buildtool.cpp @@ -6984,7 +6984,30 @@ public: dname.append(dirName); incs.append(parent.resolve(dname)); } - + +// First create all directories, fails if done in OpenMP parallel loop below... goes superfast anyway, so don't optimize + for (unsigned int fi = 0; fi < deps.size() ; ++fi) + { + DepRec dep = deps[fi]; + + //## Make paths + String destPath = dest; + if (dep.path.size()>0) + { + destPath.append("/"); + destPath.append(dep.path); + } + //## Make sure destination directory exists + if (!createDirectory(destPath)) + { + taskstatus("problem creating folder: %s", destPath.c_str()); + if (f) { + fclose(f); + } + return false; + } + } + /** * Compile each of the C files that need it */ @@ -7016,20 +7039,6 @@ public: srcPath.append("/"); srcPath.append(dep.path); } - //## Make sure destination directory exists - if (!createDirectory(destPath)) - { - taskstatus("problem creating folder: %s", destPath.c_str()); - errorOccurred = true; -#ifdef _OPENMP // figure out a way to break the loop here with OpenMP - continue; // terminate this for-loop -#else - if (f) { - fclose(f); - } - return false; -#endif - } //## Check whether it needs to be done String destName; -- cgit v1.2.3