aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2012-12-24 10:58:30 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2012-12-24 10:58:30 +0200
commit14a53a55582a2b69926f4266c125672686b68e10 (patch)
tree24ea5d7b0af61adea55a4b53d446e5d6b93afbe7
parent066548a657cf2d43cb2a1d5a7420afa315d9684f (diff)
downloadmeson-14a53a55582a2b69926f4266c125672686b68e10.zip
meson-14a53a55582a2b69926f4266c125672686b68e10.tar.gz
meson-14a53a55582a2b69926f4266c125672686b68e10.tar.bz2
Compiler class tells what files it can compile.
-rwxr-xr-xenvironment.py8
1 files changed, 7 insertions, 1 deletions
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']