Allow packages to control handling of compiler flags (#4421)
* Initial work on flag trapping using functions called <flag>_handler and default_flag_handler * Update packages so they do not obliterate flags * Added append to EnvironmentModifications class * changed EnvironmentModifications to have append_flags method * changed flag_val to be a tuple * Increased test coverage * added documentation of flag handling
This commit is contained in:
@@ -78,12 +78,18 @@ def cmake_args(self):
|
||||
cmake_args = []
|
||||
|
||||
if '+cxx11' in spec:
|
||||
env['CXXFLAGS'] = self.compiler.cxx11_flag
|
||||
if 'CXXFLAGS' in env and env['CXXFLAGS']:
|
||||
env['CXXFLAGS'] += ' ' + self.compiler.cxx11_flag
|
||||
else:
|
||||
env['CXXFLAGS'] = self.compiler.cxx11_flag
|
||||
cmake_args.append('-DCLHEP_BUILD_CXXSTD=' +
|
||||
self.compiler.cxx11_flag)
|
||||
|
||||
if '+cxx14' in spec:
|
||||
env['CXXFLAGS'] = self.compiler.cxx14_flag
|
||||
if 'CXXFLAGS' in env and env['CXXFLAGS']:
|
||||
env['CXXFLAGS'] += ' ' + self.compiler.cxx14_flag
|
||||
else:
|
||||
env['CXXFLAGS'] = self.compiler.cxx14_flag
|
||||
cmake_args.append('-DCLHEP_BUILD_CXXSTD=' +
|
||||
self.compiler.cxx14_flag)
|
||||
|
||||
|
Reference in New Issue
Block a user