]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/libjpeg.py
3 # Copyright (C) 2013 Steven Watanabe
4 # Distributed under the Boost Software License, Version 1.0.
5 # (See accompanying file LICENSE.txt or copy at
6 # https://www.bfgroup.xyz/b2/LICENSE.txt)
11 t
= BoostBuild
.Tester(arguments
=['toolset=mock', '--ignore-site-config', '--user-config='], pass_toolset
=0)
16 t
.write("libjpeg/jpeglib.h", 'libjpeg')
17 t
.write("libjpeg/jerror.c", 'jpeg')
19 t
.write("Jamroot.jam", """
20 path-constant here : . ;
21 using libjpeg : : <source>$(here)/libjpeg ;
22 alias libjpeg : /libjpeg//libjpeg : : <link>static <link>shared ;
25 MockToolset
.set_expected(t
, '''
26 source_file('jerror.c', 'jpeg')
27 action('-c -x c -I./libjpeg -o $jerror.o $jerror.c')
28 action('--dll $jerror.o -o $jpeg.so')
29 action('--archive $jerror.o -o $jpeg.a')
33 t
.expect_addition('bin/standalone/libjpeg/mock/debug/jpeg.dll')
34 t
.expect_addition('bin/standalone/libjpeg/mock/debug/link-static/jpeg.lib')
38 # Generic definitions that aren't configuration specific
40 source_file('test.cpp', 'test.cpp')
41 source_file('main.cpp', 'int main() {}')
42 source_file('jpeg.h.cpp', '#include <stdio.h>\\n#include <jpeglib.h>\\n')
43 action('-c -x c++ $main.cpp -o $main.o')
45 t
.write('test.cpp', 'test.cpp')
47 t
.write("Jamroot.jam", """
48 path-constant here : . ;
50 exe test : test.cpp /libjpeg//libjpeg ;
53 # Default initialization - static library
55 MockToolset
.set_expected(t
, common_stuff
+ '''
56 action('$main.o --static-lib=jpeg -o $config.exe')
57 action('-c -x c++ $jpeg.h.cpp -o $jpeg.h.o')
58 action('-c -x c++ $test.cpp -o $test.o')
59 action('$test.o --static-lib=jpeg -o $test')
61 t
.run_build_system(["link=static"])
62 t
.expect_addition('bin/mock/debug/link-static/test.exe')
64 # Default initialization - shared library
66 t
.write("Jamroot.jam", """
67 path-constant here : . ;
69 exe test : test.cpp /libjpeg//libjpeg ;
72 MockToolset
.set_expected(t
, common_stuff
+ '''
73 action('$main.o --shared-lib=jpeg -o $config.exe')
74 action('-c -x c++ $jpeg.h.cpp -o $jpeg.h.o')
75 action('-c -x c++ $test.cpp -o $test.o')
76 action('$test.o --shared-lib=jpeg -o $test')
78 t
.run_build_system(["link=shared"])
79 t
.expect_addition('bin/mock/debug/test.exe')
81 # Initialization in explicit location - static library
83 t
.write("Jamroot.jam", """
84 path-constant here : . ;
85 using libjpeg : : <name>mylibjpeg <include>$(here)/libjpeg <search>$(here)/libjpeg ;
86 exe test : test.cpp /libjpeg//libjpeg : : <link>static <link>shared ;
89 t
.write('libjpeg/jpeglib.h', 'libjpeg')
91 MockToolset
.set_expected(t
, common_stuff
+ '''
92 action('$main.o -L./libjpeg --static-lib=mylibjpeg -o $config.exe')
93 action('-c -x c++ $test.cpp -I./libjpeg -o $test.o')
94 action('$test.o -L./libjpeg --static-lib=mylibjpeg -o $test')
97 t
.expect_addition('bin/mock/debug/test.exe')
98 t
.expect_addition('bin/mock/debug/link-static/test.exe')
100 # Initialization in explicit location - shared library
102 t
.write("Jamroot.jam", """
103 path-constant here : . ;
104 using libjpeg : : <name>mylibjpeg <include>$(here)/libjpeg <search>$(here)/libjpeg ;
105 exe test : test.cpp /libjpeg//libjpeg : : <link>static <link>shared ;
108 MockToolset
.set_expected(t
, common_stuff
+ '''
109 action('$main.o -L./libjpeg --shared-lib=mylibjpeg -o $config.exe')
110 action('-c -x c++ $test.cpp -I./libjpeg -o $test.o')
111 action('$test.o -L./libjpeg --shared-lib=mylibjpeg -o $test')
114 t
.expect_addition('bin/mock/debug/test.exe')
115 t
.expect_addition('bin/mock/debug/link-static/test.exe')