1#!/usr/local/bin/python3.8
2
3# Copyright 2014 Steven Watanabe
4# Distributed under the Boost Software License, Version 1.0.
5# (See accompanying file LICENSE_1_0.txt or copy at
6# http://www.boost.org/LICENSE_1_0.txt)
7
8# Tests the cxxflags feature
9
10import BoostBuild
11
12t = BoostBuild.Tester(use_test_config=False)
13
14# cxxflags should be applied to C++ compilation,
15# but not to C.
16t.write("Jamroot.jam", """
17obj test-cpp : test.cpp : <cxxflags>-DOKAY ;
18obj test-c : test.c : <cxxflags>-DBAD ;
19""")
20
21t.write("test.cpp", """
22#ifndef OKAY
23#error Cannot compile without OKAY
24#endif
25""")
26
27t.write("test.c", """
28#ifdef BAD
29#error Cannot compile with BAD
30#endif
31""")
32
33t.run_build_system()
34t.expect_addition("bin/$toolset/debug*/test-cpp.obj")
35t.expect_addition("bin/$toolset/debug*/test-c.obj")
36
37t.cleanup()
38