Compiler class tells what files it can compile.

pull/15/head
Jussi Pakkanen 12 years ago
parent 066548a657
commit 14a53a5558
  1. 8
      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']

Loading…
Cancel
Save