1#!/usr/bin/python 2# 3# Copyright 2017 Steven Watanabe 4# Copyright 2020 Rene Rivera 5# 6# Distributed under the Boost Software License, Version 1.0. 7# (See accompanying file LICENSE_1_0.txt or copy at 8# http://www.boost.org/LICENSE_1_0.txt) 9 10from MockProgram import * 11 12command('clang++', '-print-prog-name=ar', stdout=script('ar.py')) 13command('clang++', '-print-prog-name=ranlib', stdout=script('ranlib.py')) 14 15if allow_properties('variant=debug', 'link=shared', 'threading=single', 'runtime-link=shared'): 16 command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/lib.o'), input_file(source='lib.cpp')) 17 command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/libl1.so'), arg_file('@bin/clang-linux-3.9.0/debug*/libl1.so.rsp'), unordered('-g', '-fPIC')) 18 command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/main.o'), input_file(source='main.cpp')) 19 command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/test'), arg_file('@bin/clang-linux-3.9.0/debug*/test.rsp'), unordered('-g', '-fPIC')) 20 21if allow_properties('variant=release', 'link=shared', 'threading=single', 'runtime-link=shared', 'strip=on'): 22 command('clang++', unordered(ordered('-x', 'c++'), '-O3', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-linux-3.9.0/release/lib.o'), input_file(source='lib.cpp')) 23 command('clang++', '-o', output_file('bin/clang-linux-3.9.0/release/strip-on/libl1.so'), arg_file('@bin/clang-linux-3.9.0/release/strip-on*/libl1.so.rsp'), unordered('-fPIC', '-Wl,--strip-all')) 24 command('clang++', unordered(ordered('-x', 'c++'), '-O3', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-linux-3.9.0/release/main.o'), input_file(source='main.cpp')) 25 command('clang++', '-o', output_file('bin/clang-linux-3.9.0/release/test'), arg_file('@bin/clang-linux-3.9.0/release/strip-on*/test.rsp'), unordered('-fPIC', '-Wl,--strip-all')) 26 27if allow_properties('variant=debug', 'link=shared', 'threading=multi', 'runtime-link=shared'): 28 command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-pthread', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/lib.o'), input_file(source='lib.cpp')) 29 command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/libl1.so'), arg_file('@bin/clang-linux-3.9.0/debug*/threading-multi/libl1.so.rsp'), unordered('-g', '-pthread', '-fPIC')) 30 command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-pthread', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/main.o'), input_file(source='main.cpp')) 31 command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/test'), arg_file('@bin/clang-linux-3.9.0/debug*/threading-multi/test.rsp'), unordered('-g', '-pthread', '-fPIC')) 32 33if allow_properties('variant=debug', 'link=static', 'threading=single', 'runtime-link=shared'): 34 command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/lib.o'), input_file(source='lib.cpp')) 35 command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/main.o'), input_file(source='main.cpp')) 36 command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/test'), arg_file('@bin/clang-linux-3.9.0/debug/link-static*/test.rsp'), '-g') 37 38if allow_properties('variant=debug', 'link=static', 'threading=single', 'runtime-link=static'): 39 command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/lib.o'), input_file(source='lib.cpp')) 40 command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/main.o'), input_file(source='main.cpp')) 41 command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/test'), arg_file('@bin/clang-linux-3.9.0/debug/link-static/runtime-link-static*/test.rsp'), unordered('-g', '-static')) 42 43if allow_properties('variant=debug', 'link=shared', 'threading=single', 'runtime-link=shared', 'architecture=x86', 'address-model=32'): 44 command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/lib.o'), input_file(source='lib.cpp')) 45 command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/libl1.so'), arg_file('@bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86*/libl1.so.rsp'), unordered('-g', '-march=i686', '-fPIC', '-m32')) 46 command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/main.o'), input_file(source='main.cpp')) 47 command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/test'), arg_file('@bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86*/test.rsp'), unordered('-g', '-march=i686', '-fPIC', '-m32')) 48 49main() 50