From 679aa01b7ca93638c54acbf6972677212b6967f6 Mon Sep 17 00:00:00 2001 From: Kevin Dinkel <1225857+dinkelk@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:25:59 -0600 Subject: [PATCH] Hot fix #2 to amend https://github.com/lasp/adamant/pull/85 --- redo/rules/build_executable.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/redo/rules/build_executable.py b/redo/rules/build_executable.py index 8c7df7d..08c379a 100644 --- a/redo/rules/build_executable.py +++ b/redo/rules/build_executable.py @@ -225,15 +225,17 @@ def _build(self, redo_1, redo_2, redo_3): c_source_exclude = [] # Iterate over each directory in the C source path list + # to find C source files that may need to be excluded for directory in c_source_path: - # Walk the directory and find all files - for files in os.listdir(directory): - for file in files: - # Check if the file has one of the supported extensions - basename, fext = os.path.splitext(file) + for fname in os.listdir(directory): + full_path = os.path.join(directory, fname) + if os.path.isfile(full_path): + # If the file is a source file, but doesn't have + # an object built for it, then we need to exclude it + basename, fext = os.path.splitext(fname) if fext in source_extensions and \ basename not in existing_c_basenames: - c_source_exclude.append(os.path.basename(file)) + c_source_exclude.append(os.path.basename(fname)) # Sym link any c objects into the executable object directory, since # these would not have gotten symlinked like all the ada objects