Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/56590 )

Change subject: scons: Use either the "build" or ".gem5" dirs as build anchor.
......................................................................

scons: Use either the "build" or ".gem5" dirs as build anchor.

There isn't currently a way to create a build directory not called
build, but with this change SCons will at least recognize those
directories once they exist. A build directory can now be renamed, for
instance.

Change-Id: I8705b3dbb7664748f5525869cb188df70319d403
---
M site_scons/gem5_scons/__init__.py
1 file changed, 18 insertions(+), 1 deletion(-)



diff --git a/site_scons/gem5_scons/__init__.py b/site_scons/gem5_scons/__init__.py
index bf7b85d..ba8fc52 100644
--- a/site_scons/gem5_scons/__init__.py
+++ b/site_scons/gem5_scons/__init__.py
@@ -39,6 +39,7 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 import os
+import os.path
 import pickle
 import sys
 import tempfile
@@ -233,7 +234,9 @@
# Search backwards for the "build" directory. Whatever was just before it
     # was the name of the variant.
     variant_dir = path_dirs.pop()
-    while path_dirs and path_dirs[-1] != 'build':
+    dot_gem5 = os.path.join('/', *path_dirs, '.gem5')
+    while path_dirs and path_dirs[-1] != 'build' and \
+            not os.path.isdir(dot_gem5):
         variant_dir = path_dirs.pop()
     if not path_dirs:
         error("No non-leaf 'build' dir found on target path.", t)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/56590
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I8705b3dbb7664748f5525869cb188df70319d403
Gerrit-Change-Number: 56590
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to