Skip to content

Commit ca81cd3

Browse files
committed
Merge pull request #98888 from dustdfg/scu_rely_on_scons
SCons: Replace `_find_scu_section_name` function with SCons builtins
2 parents f74b7e2 + 32e2b45 commit ca81cd3

File tree

1 file changed

+2
-33
lines changed

1 file changed

+2
-33
lines changed

methods.py

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -90,35 +90,6 @@ def add_source_files_orig(self, sources, files, allow_gen=False):
9090
sources.append(obj)
9191

9292

93-
# The section name is used for checking
94-
# the hash table to see whether the folder
95-
# is included in the SCU build.
96-
# It will be something like "core/math".
97-
def _find_scu_section_name(subdir):
98-
section_path = os.path.abspath(subdir) + "/"
99-
100-
folders = []
101-
folder = ""
102-
103-
for i in range(8):
104-
folder = os.path.dirname(section_path)
105-
folder = os.path.basename(folder)
106-
if folder == base_folder_only:
107-
break
108-
folders += [folder]
109-
section_path += "../"
110-
section_path = os.path.abspath(section_path) + "/"
111-
112-
section_name = ""
113-
for n in range(len(folders)):
114-
# section_name += folders[len(folders) - n - 1] + " "
115-
section_name += folders[len(folders) - n - 1]
116-
if n != (len(folders) - 1):
117-
section_name += "/"
118-
119-
return section_name
120-
121-
12293
def add_source_files_scu(self, sources, files, allow_gen=False):
12394
if self["scu_build"] and isinstance(files, str):
12495
if "*." not in files:
@@ -127,10 +98,8 @@ def add_source_files_scu(self, sources, files, allow_gen=False):
12798
# If the files are in a subdirectory, we want to create the scu gen
12899
# files inside this subdirectory.
129100
subdir = os.path.dirname(files)
130-
if subdir != "":
131-
subdir += "/"
132-
133-
section_name = _find_scu_section_name(subdir)
101+
subdir = subdir if subdir == "" else subdir + "/"
102+
section_name = self.Dir(subdir).tpath
134103
# if the section name is in the hash table?
135104
# i.e. is it part of the SCU build?
136105
global _scu_folders

0 commit comments

Comments
 (0)