Skip to content

Commit

Permalink
Added compilation warning about missing c++ compiler
Browse files Browse the repository at this point in the history
If the CXX environement variable is not set, then the build must stop
and the user be notified.
  • Loading branch information
Naughtylus committed Nov 1, 2016
1 parent a1b50f6 commit e9910dc
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Works on all UNIX-like operating systems.

import os
import sys
import SCons.Errors

from fnmatch import fnmatch

Expand Down Expand Up @@ -80,11 +81,15 @@ class FreelanEnvironment(Environment):
self.install_prefix = self.prefix
self.bin_install_prefix = self.bin_prefix

if os.path.basename(self['CXX']) == 'clang++':
self.Append(CXXFLAGS=['-Qunused-arguments'])
self.Append(CXXFLAGS=['-fcolor-diagnostics'])
elif os.path.basename(self['CXX']).startswith('g++'):
self.Append(CXXFLAGS=['-Wno-missing-field-initializers'])
if self['CXX'] is None:
raise SCons.Errors.BuildError(
errstr="CXX environment variable not set. Are you missing a C++ compiler?");
else:
if os.path.basename(self['CXX']) == 'clang++':
self.Append(CXXFLAGS=['-Qunused-arguments'])
self.Append(CXXFLAGS=['-fcolor-diagnostics'])
elif os.path.basename(self['CXX']).startswith('g++'):
self.Append(CXXFLAGS=['-Wno-missing-field-initializers'])

self.Append(CXXFLAGS=['--std=c++11'])
self.Append(CXXFLAGS=['-Wall'])
Expand Down

0 comments on commit e9910dc

Please sign in to comment.