blob: 07eb1296e3b20e2f94cd35c85af754099a24b94e [file] [log] [blame]
Junxiao Shib2bcbcd2014-11-08 09:30:28 -07001# -*- 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
7from waflib import Configure
8
Davide Pesaventob499a602014-11-18 22:36:56 +01009IS_DEFAULT_CONSTRUCTIBLE_CHECK = '''
10#include <type_traits>
11static_assert(std::is_default_constructible<int>::value, "");
12'''
13
Junxiao Shib2bcbcd2014-11-08 09:30:28 -070014IS_MOVE_CONSTRUCTIBLE_CHECK = '''
15#include <type_traits>
16static_assert(std::is_move_constructible<int>::value, "");
17'''
18
19def configure(conf):
Davide Pesaventob499a602014-11-18 22:36:56 +010020 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
Junxiao Shib2bcbcd2014-11-08 09:30:28 -070026 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