• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# (C) Copyright 2015: Kyle Lutz
2# Distributed under the Boost Software License, Version 1.0.
3# (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4
5import testing ;
6
7lib boost_unit_test_framework ;
8
9obj has_opencl : check/has_opencl.cpp ;
10explicit has_opencl ;
11
12project
13    : source-location .
14    : requirements
15        <define>BOOST_ALL_NO_LIB=1
16        <toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
17        <toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
18        <toolset>msvc:<define>NOMINMAX
19        <toolset>msvc:<cxxflags>/wd4003 # Not enough actual parameters for a BOOST_PP macro
20        <toolset>msvc:<cxxflags>/wd4244 # Warning C4244: 'initializing': conversion from 'double' to 'int', possible loss of data
21        <toolset>msvc:<cxxflags>/wd4305 # Warning C4305: 'initializing': truncation from 'double' to 'float'
22        <toolset>msvc:<cxxflags>/wd4800 # Warning C4800: 'uint32_t' : forcing value to bool 'true' or 'false' (performance warning)
23        <toolset>msvc:<cxxflags>/wd4838 # Warning C4838: conversion from 'double' to 'float' requires a narrowing conversion
24        <library>/boost/test//boost_unit_test_framework
25
26        [ check-target-builds has_opencl "OpenCL" : : <build>no ]
27    ;
28
29rule test_all
30{
31    local all_rules = ;
32
33    for local fileb in [ glob *.cpp ]
34    {
35        all_rules += [ run $(fileb)
36        :
37        :
38        :
39            <link>shared:<define>BOOST_TEST_DYN_LINK=1
40            <host-os>linux:<linkflags>"-lOpenCL"
41            <host-os>darwin:<linkflags>"-framework OpenCL"
42            <host-os>freebsd:<linkflags>"-lOpenCL"
43        ] ;
44    }
45
46    return $(all_rules) ;
47}
48
49test-suite compute : [ test_all r ] :  ;
50