From 14a53a55582a2b69926f4266c125672686b68e10 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 24 Dec 2012 10:58:30 +0200 Subject: Compiler class tells what files it can compile. --- environment.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'environment.py') diff --git a/environment.py b/environment.py index 02fe841..e4bb2ff 100755 --- a/environment.py +++ b/environment.py @@ -28,7 +28,7 @@ def detect_c_compiler(execmd): if (out.startswith('cc ') or out.startswith('gcc')) and \ 'Free Software Foundation' in out: return GnuCCompiler(exelist) - raise EnvironmentException('Unknown compiler ' + execmd) + raise EnvironmentException('Unknown compiler "' + execmd + '"') class CCompiler(): def __init__(self, exelist): @@ -42,6 +42,12 @@ class CCompiler(): def get_output_flags(self): return ['-o'] + + def can_compile(self, filename): + suffix = filename.split['.'][-1] + if suffix == 'c' or suffix == 'h': + return True + return False class GnuCCompiler(CCompiler): std_warn_flags = ['-Wall', '-Winvalid-pch'] -- cgit v1.1