Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| 2 | # |
| 3 | # Copyright (c) 2014, Regents of the University of California |
| 4 | # |
| 5 | # GPL 3.0 license, see the COPYING.md file for more information |
| 6 | |
| 7 | from waflib import Configure |
| 8 | |
| 9 | IS_DEFAULT_CONSTRUCTIBLE_CHECK = ''' |
| 10 | #include <type_traits> |
| 11 | static_assert(std::is_default_constructible<int>::value, ""); |
| 12 | ''' |
| 13 | |
| 14 | IS_MOVE_CONSTRUCTIBLE_CHECK = ''' |
| 15 | #include <type_traits> |
| 16 | static_assert(std::is_move_constructible<int>::value, ""); |
| 17 | ''' |
| 18 | |
| 19 | def configure(conf): |
| 20 | if conf.check_cxx(msg='Checking for std::is_default_constructible', |
| 21 | fragment=IS_DEFAULT_CONSTRUCTIBLE_CHECK, |
| 22 | features='cxx', mandatory=False): |
| 23 | conf.define('HAVE_IS_DEFAULT_CONSTRUCTIBLE', 1) |
| 24 | conf.env['HAVE_IS_DEFAULT_CONSTRUCTIBLE'] = True |
| 25 | |
| 26 | if conf.check_cxx(msg='Checking for std::is_move_constructible', |
| 27 | fragment=IS_MOVE_CONSTRUCTIBLE_CHECK, |
| 28 | features='cxx', mandatory=False): |
| 29 | conf.define('HAVE_IS_MOVE_CONSTRUCTIBLE', 1) |
| 30 | conf.env['HAVE_IS_MOVE_CONSTRUCTIBLE'] = True |