compiler flags: add cxx98 standard support (#7601)
The following improvements are made to cxx standard support (e.g. compiler.cxxNN_flag functions) in compilers: * Add cxx98_flag property * Add support for throwing an exception when a flag is not supported (previously if a flag was not supported the application was terminated with tty.die) * The name of the flag associated with e.g. c++14 standard support changes for different compiler versions (e.g. c++1y vs c++14). This makes a few corrections on what flag to return for which version. * Added tests to confirm that versions report expected flags for various c++ standards (or raise an exception for versions that don't provide a given cxx standard) Note that if a given cxx standard is the default, the associated flag property will return ""; cxx98 is assumed to be the default standard so this is the behavior for the associated property in the base compiler class. Package changes: * Improvements to the boost spec to take advantage of the improved standard flag facility. * Update the clingo spec to catch the new exception rather than look for an empty flag to indicate non-support (which is not part of the compiler flag API)
This commit is contained in:
@@ -44,7 +44,9 @@ class Clingo(CMakePackage):
|
||||
depends_on('python')
|
||||
|
||||
def cmake_args(self):
|
||||
if not self.compiler.cxx14_flag:
|
||||
try:
|
||||
self.compiler.cxx14_flag
|
||||
except UnsupportedCompilerFlag:
|
||||
InstallError('clingo requires a C++14-compliant C++ compiler')
|
||||
|
||||
args = ['-DCLINGO_BUILD_WITH_PYTHON=ON',
|
||||
|
||||
Reference in New Issue
Block a user