aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dependencies.py6
-rw-r--r--ninjabackend.py6
2 files changed, 8 insertions, 4 deletions
diff --git a/dependencies.py b/dependencies.py
index ca264e2..4668ccf 100644
--- a/dependencies.py
+++ b/dependencies.py
@@ -137,7 +137,11 @@ class ExternalProgram():
self.fullpath = [shutil.which(name)]
if self.fullpath[0] is None and search_dir is not None:
trial = os.path.join(search_dir, name)
- if os.access(trial, os.X_OK):
+ suffix = os.path.splitext(trial)[-1].lower()
+ if environment.is_windows() and (suffix == 'exe' or suffix == 'com'\
+ or suffix == 'bat'):
+ self.fullpath = [trial]
+ elif not environment.is_windows() and os.access(trial, os.X_OK):
self.fullpath = [trial]
else:
# Now getting desperate. Maybe it is a script file that is a) not chmodded
diff --git a/ninjabackend.py b/ninjabackend.py
index d9a9b5b..8511a15 100644
--- a/ninjabackend.py
+++ b/ninjabackend.py
@@ -1079,12 +1079,12 @@ rule FORTRAN_DEP_HACK
else:
rel_src = os.path.join(self.build_to_src, target.get_source_subdir(), src)
abs_src = os.path.join(self.environment.get_build_dir(), rel_src)
- if os.path.isabs(src):
+ if isinstance(src, RawFilename):
+ src_filename = src.fname
+ elif os.path.isabs(src):
src_filename = os.path.basename(src)
else:
src_filename = src
- if isinstance(src, RawFilename):
- src_filename = src.fname
obj_basename = src_filename.replace('/', '_').replace('\\', '_')
rel_obj = os.path.join(self.get_target_private_dir(target), obj_basename)
rel_obj += '.' + self.environment.get_object_suffix()