blob: 07eb1296e3b20e2f94cd35c85af754099a24b94e [file] [log] [blame]
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +00001# -*- 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
9IS_DEFAULT_CONSTRUCTIBLE_CHECK = '''
10#include <type_traits>
11static_assert(std::is_default_constructible<int>::value, "");
12'''
13
14IS_MOVE_CONSTRUCTIBLE_CHECK = '''
15#include <type_traits>
16static_assert(std::is_move_constructible<int>::value, "");
17'''
18
19def 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