]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_index/test/Jamfile.v2
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / type_index / test / Jamfile.v2
1 # Copyright (C) 2012-2014 Antony Polukhin
2 #
3 # Distributed under the Boost Software License, Version 1.0. (See accompanying
4 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 #
6
7 import testing ;
8 import feature ;
9 import os ;
10
11 # Variable that contains all the stuff required for linking together <rtti>on and <rtti>off
12 compat = <define>BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY ;
13
14 # Making own `nortti` that is link compatible.
15 # We explicitly define BOOST_NO_RTTI because it sometimes can not be detected by build system.
16 nortti = <toolset>gcc:"<cxxflags>-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID" <toolset>clang:"<cxxflags>-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID" <toolset>intel:"<cxxflags>-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID" <toolset>darwin:"<cxxflags>-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID" <toolset>msvc:<cxxflags>/GR- ;
17
18 norttidefines = <toolset>gcc:"<cxxflags>-DBOOST_NO_RTTI -DBOOST_NO_TYPEID" <toolset>clang:"<cxxflags>-DBOOST_NO_RTTI -DBOOST_NO_TYPEID" <toolset>intel:"<cxxflags>-DBOOST_NO_RTTI -DBOOST_NO_TYPEID" <toolset>darwin:"<cxxflags>-DBOOST_NO_RTTI -DBOOST_NO_TYPEID" <toolset>msvc:<cxxflags>-DBOOST_NO_RTTI ;
19
20
21 # Making libraries that CANNOT work between rtti-on/rtti-off modules
22 obj test_lib_nortti-obj : test_lib.cpp : <link>shared <rtti>off $(norttidefines) ;
23 obj test_lib_anonymous_nortti-obj : test_lib_anonymous.cpp : <link>shared <rtti>off $(norttidefines) ;
24 lib test_lib_nortti : test_lib_nortti-obj : <link>shared <rtti>off $(norttidefines) ;
25 lib test_lib_anonymous_nortti : test_lib_anonymous_nortti-obj : <link>shared <rtti>off $(norttidefines) ;
26
27 obj test_lib_rtti-obj : test_lib.cpp : <link>shared ;
28 obj test_lib_anonymous_rtti-obj : test_lib_anonymous.cpp : <link>shared ;
29 lib test_lib_rtti : test_lib_rtti-obj : <link>shared ;
30 lib test_lib_anonymous_rtti : test_lib_anonymous_rtti-obj : <link>shared ;
31
32 # Making libraries that can work between rtti-on/rtti-off modules
33 obj test_lib_nortti_compat-obj : test_lib.cpp : <link>shared $(nortti) $(compat) ;
34 obj test_lib_rtti_compat-obj : test_lib.cpp : <link>shared $(nortti) $(compat) ;
35 lib test_lib_nortti_compat : test_lib_nortti_compat-obj : <link>shared $(nortti) $(compat) ;
36 lib test_lib_rtti_compat : test_lib_rtti_compat-obj : <link>shared $(nortti) $(compat) ;
37
38 exe testing_crossmodule_anonymous_no_rtti : testing_crossmodule_anonymous.cpp test_lib_anonymous_nortti : <rtti>off $(norttidefines) ;
39
40 test-suite type_index
41 :
42 [ run type_index_test.cpp ]
43 [ run type_index_runtime_cast_test.cpp ]
44 [ run type_index_constexpr_test.cpp ]
45 [ run type_index_test.cpp : : : <rtti>off $(norttidefines) : type_index_test_no_rtti ]
46 [ run ctti_print_name.cpp : : : <test-info>always_show_run_output ]
47 [ run testing_crossmodule.cpp test_lib_rtti ]
48 [ run testing_crossmodule.cpp test_lib_nortti : : : <rtti>off $(norttidefines) : testing_crossmodule_no_rtti ]
49 [ run testing_crossmodule_anonymous.cpp test_lib_anonymous_rtti ]
50 [ run compare_ctti_stl.cpp ]
51
52 [ compile-fail type_index_test_ctti_copy_fail.cpp ]
53 [ compile-fail type_index_test_ctti_construct_fail.cpp ]
54 [ compile type_index_test_ctti_alignment.cpp ]
55
56 # Mixing RTTI on and off
57 [ link-fail testing_crossmodule.cpp test_lib_rtti : $(nortti) : link_fail_nortti_rtti ]
58 # MSVC sometimes overrides the /GR-, without `detect_missmatch` this test may link
59 [ link-fail testing_crossmodule.cpp test_lib_nortti : : link_fail_rtti_nortti ]
60 [ run testing_crossmodule.cpp test_lib_rtti_compat : : : $(nortti) $(compat) : testing_crossmodule_nortti_rtti_compat ]
61 [ run testing_crossmodule.cpp test_lib_nortti_compat : : : $(compat) : testing_crossmodule_rtti_nortti_compat ]
62 ;
63
64 # Assuring that examples compile and run. Adding sources from `examples` directory to the `type_index` test suite.
65 for local p in [ glob ../examples/*.cpp ]
66 {
67 # RTTI on
68 type_index += [ run $(p) ] ;
69
70 # RTTI off
71 local target_name = $(p[1]:B)_no_rtti ;
72 if $(target_name) != "table_of_names_no_rtti"
73 {
74 type_index += [ run $(p) : : : <rtti>off $(norttidefines) : $(target_name) ] ;
75 }
76 }
77