Mxx_ru 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +26 -26
- data/NEWS +107 -107
- data/README +21 -21
- data/Rakefile +56 -59
- data/examples/exe_and_lib/prj.rb +11 -11
- data/examples/exe_and_lib/say.rb +7 -7
- data/examples/exe_dll_lib/inout.rb +18 -18
- data/examples/exe_dll_lib/prj.rb +11 -11
- data/examples/exe_dll_lib/say.rb +9 -9
- data/examples/exe_dll_lib_2/build.rb +10 -10
- data/examples/exe_dll_lib_2/inout/prj.rb +16 -16
- data/examples/exe_dll_lib_2/main/prj.rb +9 -9
- data/examples/exe_dll_lib_2/say/prj.rb +8 -8
- data/examples/simple_exe/prj.rb +7 -7
- data/lib/mxx_ru/abstract_target.rb +335 -335
- data/lib/mxx_ru/binary_library.rb +106 -106
- data/lib/mxx_ru/binary_target.rb +173 -173
- data/lib/mxx_ru/binary_unittest.rb +143 -143
- data/lib/mxx_ru/compat.rb +33 -33
- data/lib/mxx_ru/cpp.rb +38 -38
- data/lib/mxx_ru/cpp/analyzer.rb +237 -237
- data/lib/mxx_ru/cpp/composite.rb +118 -118
- data/lib/mxx_ru/cpp/detect_toolset.rb +122 -122
- data/lib/mxx_ru/cpp/mode.rb +90 -90
- data/lib/mxx_ru/cpp/obj_placement.rb +330 -330
- data/lib/mxx_ru/cpp/obj_placements/custom_subdir.rb +155 -155
- data/lib/mxx_ru/cpp/qt.rb +366 -366
- data/lib/mxx_ru/cpp/rucodegen.rb +157 -157
- data/lib/mxx_ru/cpp/source_file.rb +79 -79
- data/lib/mxx_ru/cpp/target.rb +1523 -1523
- data/lib/mxx_ru/cpp/toolset.rb +1087 -1087
- data/lib/mxx_ru/cpp/toolsets/bcc_win32_5.rb +53 -53
- data/lib/mxx_ru/cpp/toolsets/bcc_win32_family.rb +460 -460
- data/lib/mxx_ru/cpp/toolsets/c89_etk_nsk.rb +59 -59
- data/lib/mxx_ru/cpp/toolsets/c89_nsk.rb +59 -59
- data/lib/mxx_ru/cpp/toolsets/c89_nsk_family.rb +277 -277
- data/lib/mxx_ru/cpp/toolsets/gcc_cygwin.rb +58 -58
- data/lib/mxx_ru/cpp/toolsets/gcc_family.rb +420 -424
- data/lib/mxx_ru/cpp/toolsets/gcc_linux.rb +64 -64
- data/lib/mxx_ru/cpp/toolsets/gcc_mingw.rb +150 -150
- data/lib/mxx_ru/cpp/toolsets/gcc_sparc_solaris.rb +91 -91
- data/lib/mxx_ru/cpp/toolsets/gcc_unix_family.rb +103 -84
- data/lib/mxx_ru/cpp/toolsets/vc7.rb +62 -62
- data/lib/mxx_ru/cpp/toolsets/vc8.rb +455 -455
- data/lib/mxx_ru/cpp/toolsets/vc_family.rb +448 -448
- data/lib/mxx_ru/ex.rb +165 -165
- data/lib/mxx_ru/makestyle_generator.rb +146 -146
- data/lib/mxx_ru/textfile_unittest.rb +303 -303
- data/lib/mxx_ru/util.rb +340 -340
- data/tests/c/pcre/chartables.c +183 -183
- data/tests/c/pcre/config.h +99 -99
- data/tests/c/pcre/dftables.c +167 -167
- data/tests/c/pcre/get.c +349 -349
- data/tests/c/pcre/internal.h +677 -677
- data/tests/c/pcre/maketables.c +140 -140
- data/tests/c/pcre/pcre.c +8304 -8304
- data/tests/c/pcre/pcre.h +193 -193
- data/tests/c/pcre/pcre.rb +14 -14
- data/tests/c/pcre/pcredemo.c +316 -316
- data/tests/c/pcre/pcregrep.c +642 -642
- data/tests/c/pcre/pcreposix.c +305 -305
- data/tests/c/pcre/pcreposix.h +88 -88
- data/tests/c/pcre/pcretest.c +1483 -1483
- data/tests/c/pcre/perltest +211 -211
- data/tests/c/pcre/printint.c +360 -360
- data/tests/c/pcre/study.c +472 -472
- data/tests/cpp/cpp_sources_glob/build.rb +7 -7
- data/tests/cpp/cpp_sources_glob/some/module/prj.rb +10 -10
- data/tests/cpp/cpp_sources_glob/tc_cpp_sources_glob.rb +18 -18
- data/tests/cpp/mswin_res_dll/build.rb +14 -14
- data/tests/cpp/mswin_res_dll/dll.cpp +17 -17
- data/tests/cpp/mswin_res_dll/dll.rb +29 -29
- data/tests/cpp/mswin_res_dll/dll.rc +48 -48
- data/tests/cpp/mswin_res_dll/h/dll.hpp +8 -8
- data/tests/cpp/mswin_res_dll/h/res.h +3 -3
- data/tests/cpp/mswin_res_dll/main.cpp +13 -13
- data/tests/cpp/mswin_res_dll/main.rb +19 -19
- data/tests/cpp/mswin_res_dll/tc_mswin_res_dll.rb +18 -18
- data/tests/cpp/mswin_res_exe/build.rb +23 -23
- data/tests/cpp/mswin_res_exe/h/res.h +3 -3
- data/tests/cpp/mswin_res_exe/main.cpp +17 -17
- data/tests/cpp/mswin_res_exe/main.rc +48 -48
- data/tests/cpp/mswin_res_exe/tc_mswin_res_exe.rb +18 -18
- data/tests/cpp/rucodegen.embedded/host_config.cpp +32 -32
- data/tests/cpp/rucodegen.embedded/impl/conn_params.cpp +7 -7
- data/tests/cpp/rucodegen.embedded/impl/conn_params.rb +14 -14
- data/tests/cpp/rucodegen.embedded/impl/h/conn_params.hpp +10 -10
- data/tests/cpp/rucodegen.embedded/prj.rb +16 -16
- data/tests/cpp/rucodegen.embedded/tc_rucodegen.rb +18 -18
- data/tests/cpp/rucodegen/host_config.cpp +20 -20
- data/tests/cpp/rucodegen/host_config.rb +14 -14
- data/tests/cpp/rucodegen/impl/conn_params.cpp +7 -7
- data/tests/cpp/rucodegen/impl/conn_params.rb +14 -14
- data/tests/cpp/rucodegen/impl/h/conn_params.hpp +10 -10
- data/tests/cpp/rucodegen/prj.rb +16 -16
- data/tests/cpp/rucodegen/tc_rucodegen.rb +18 -18
- data/tests/cpp/textfile_unittest/build.rb +8 -8
- data/tests/cpp/textfile_unittest/etalons/out_1.txt +1 -1
- data/tests/cpp/textfile_unittest/etalons/out_128.txt +128 -128
- data/tests/cpp/textfile_unittest/main.cpp +89 -89
- data/tests/cpp/textfile_unittest/prj.rb +8 -8
- data/tests/cpp/textfile_unittest/prj.ut.rb +18 -18
- data/tests/cpp/textfile_unittest/tc_textfile_unittest.rb +18 -18
- data/tests/cpp/toolset_name.rb +6 -6
- data/tests/cpp/vc_cleanup/prj_dll_no_implib.rb +10 -10
- data/tests/cpp/vc_cleanup/prj_dll_no_implib_simple_target_root.rb +11 -11
- data/tests/cpp/vc_cleanup/prj_dll_with_implib.rb +11 -11
- data/tests/cpp/vc_cleanup/prj_dll_with_implib_simple_target_root.rb +14 -14
- data/tests/cpp/vc_cleanup/prj_exe_no_implib.rb +10 -10
- data/tests/cpp/vc_cleanup/prj_exe_no_implib_simple_target_root.rb +11 -11
- data/tests/cpp/vc_cleanup/prj_lib.rb +10 -10
- data/tests/cpp/vc_cleanup/prj_lib_with_simple_target_root.rb +11 -11
- data/tests/cpp/vc_cleanup/tc_vc_cleanup.rb +23 -23
- data/tests/mxx_ru/binary_library/tc_binary_library.rb +57 -57
- data/tests/mxx_ru/binary_library/tc_binary_target_lib_methods.rb +114 -114
- data/tests/mxx_ru/change_default_value/ignoring_by_build_root/build.rb +8 -8
- data/tests/mxx_ru/change_default_value/ignoring_by_build_root/child_1.rb +5 -5
- data/tests/mxx_ru/change_default_value/ignoring_by_child_1/build.rb +7 -7
- data/tests/mxx_ru/change_default_value/ignoring_by_child_1/child_1.rb +5 -5
- data/tests/mxx_ru/change_default_value/ignoring_by_child_1/child_2.rb +5 -5
- data/tests/mxx_ru/change_default_value/ok/build.rb +8 -8
- data/tests/mxx_ru/change_default_value/ok/child_1.rb +8 -8
- data/tests/mxx_ru/lib_path/build.rb +8 -8
- data/tests/mxx_ru/lib_path/bye.rb +8 -8
- data/tests/mxx_ru/lib_path/hi.rb +8 -8
- data/tests/mxx_ru/lib_path/main.rb +12 -12
- data/tests/mxx_ru/lib_path/tc_lib_path.rb +18 -18
- data/tests/mxx_ru/obj_placements/tc_custom_subdir.rb +58 -58
- data/tests/mxx_ru/opt_lib_ext/build.rb +7 -7
- data/tests/mxx_ru/opt_lib_ext/hi.rb +7 -7
- data/tests/mxx_ru/opt_lib_ext/tc_opt_lib_ext.rb +18 -18
- data/tests/mxx_ru/opt_lib_ext/test-no-ext.rb +9 -9
- data/tests/mxx_ru/opt_lib_ext/test-with-ext.rb +13 -13
- data/tests/mxx_ru/plural_form_methods/tc.rb +72 -72
- data/tests/mxx_ru/qt_gen/tc_uic_result_subdir.rb +76 -76
- data/tests/mxx_ru/target_ext/prj_dll.rb +8 -8
- data/tests/mxx_ru/target_ext/prj_exe.rb +8 -8
- data/tests/mxx_ru/target_ext/prj_lib.rb +8 -8
- data/tests/mxx_ru/target_ext/tc_target_ext.rb +24 -24
- data/tests/mxx_ru/tc_makestyle_generator.rb +117 -117
- data/tests/mxx_ru/vc8/tc_actual_manifest.rb +230 -230
- data/tests/mxx_ru/vc8/tc_append_mt_commands.rb +104 -104
- data/tests/mxx_ru/vc8/tc_default_manifest.rb +17 -17
- data/tests/mxx_ru/vc8/tc_define_manifest.rb +173 -173
- data/tests/mxx_ru/vc8/tc_drop_default_manifest.rb +16 -16
- data/tests/mxx_ru/vc8/tc_invalid_params.rb +81 -81
- data/tests/mxx_ru/vc8/ts_vc8.rb +10 -10
- data/tests/qt/aclock/aclock.cpp +148 -148
- data/tests/qt/aclock/aclock.h +45 -45
- data/tests/qt/aclock/main.cpp +28 -28
- data/tests/qt/aclock/prj.rb +21 -21
- data/tests/qt/iconview/main.cpp +76 -76
- data/tests/qt/iconview/prj.rb +21 -21
- data/tests/qt/toplevel/main.cpp +9 -9
- data/tests/qt/toplevel/options.ui +587 -587
- data/tests/qt/toplevel/prj.rb +22 -22
- data/tests/test_with_compilation.rb +110 -110
- data/tests/unix/lib_linking_mode/a_shared.rb +7 -7
- data/tests/unix/lib_linking_mode/a_static.rb +7 -7
- data/tests/unix/lib_linking_mode/etalon/shared.txt +2 -2
- data/tests/unix/lib_linking_mode/etalon/static.txt +2 -2
- data/tests/unix/lib_linking_mode/main_conflict.rb +12 -12
- data/tests/unix/lib_linking_mode/main_conflict_2.rb +11 -11
- data/tests/unix/lib_linking_mode/main_shared.rb +9 -9
- data/tests/unix/lib_linking_mode/main_shared.ut.rb +11 -11
- data/tests/unix/lib_linking_mode/main_shared_2.rb +10 -10
- data/tests/unix/lib_linking_mode/main_shared_2.ut.rb +11 -11
- data/tests/unix/lib_linking_mode/main_static.rb +9 -9
- data/tests/unix/lib_linking_mode/main_static.ut.rb +11 -11
- data/tests/unix/lib_linking_mode/main_static_2.rb +10 -10
- data/tests/unix/lib_linking_mode/main_static_2.ut.rb +11 -11
- data/tests/unix/lib_linking_mode/tc_conflicted_build.rb +18 -18
- data/tests/unix/lib_linking_mode/tc_normal_build.rb +18 -18
- data/tests/unix/lib_order/a.cpp +4 -0
- data/tests/unix/lib_order/a.hpp +1 -0
- data/tests/unix/lib_order/a.rb +8 -0
- data/tests/unix/lib_order/b.cpp +10 -0
- data/tests/unix/lib_order/b.hpp +1 -0
- data/tests/unix/lib_order/b.rb +8 -0
- data/tests/unix/lib_order/build.rb +9 -0
- data/tests/unix/lib_order/c.cpp +12 -0
- data/tests/unix/lib_order/c.hpp +2 -0
- data/tests/unix/lib_order/c.rb +8 -0
- data/tests/unix/lib_order/d.cpp +7 -0
- data/tests/unix/lib_order/d.hpp +1 -0
- data/tests/unix/lib_order/d.rb +8 -0
- data/tests/unix/lib_order/main.cpp +7 -0
- data/tests/unix/lib_order/main.rb +14 -0
- data/tests/unix/lib_order/tc_normal_build.rb +16 -0
- metadata +342 -319
data/lib/mxx_ru/cpp/composite.rb
CHANGED
@@ -1,118 +1,118 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright (c) 1996-2004, Yauheni Akhotnikau
|
3
|
-
# Copyright (c) 2004-2006, JSC Intervale
|
4
|
-
# Copyright (c) 2006, The Mxx_ru Project
|
5
|
-
# All rights reserved.
|
6
|
-
#
|
7
|
-
# Redistribution and use in source and binary forms, with or without modification,
|
8
|
-
# are permitted provided that the following conditions are met:
|
9
|
-
#
|
10
|
-
# 1. Redistributions of source code must retain the above copyright notice,
|
11
|
-
# this list of conditions and the following disclaimer.
|
12
|
-
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
13
|
-
# this list of conditions and the following disclaimer in the documentation
|
14
|
-
# and/or other materials provided with the distribution.
|
15
|
-
# 3. The name of the author may not be used to endorse or promote products derived
|
16
|
-
# from this software without specific prior written permission.
|
17
|
-
#
|
18
|
-
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
19
|
-
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
20
|
-
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
|
21
|
-
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
22
|
-
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
23
|
-
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
-
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
25
|
-
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
26
|
-
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
-
#++
|
28
|
-
|
29
|
-
require 'mxx_ru/cpp/target'
|
30
|
-
|
31
|
-
module MxxRu
|
32
|
-
|
33
|
-
module Cpp
|
34
|
-
|
35
|
-
# Target type is a composition of subprojects
|
36
|
-
class CompositeTargetType < TargetType
|
37
|
-
TYPE = "composite"
|
38
|
-
|
39
|
-
def name
|
40
|
-
return TYPE
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
# For compatibility with previous versions.
|
45
|
-
Composite_target_type = CompositeTargetType
|
46
|
-
|
47
|
-
# Composition of subprojects target
|
48
|
-
class CompositeTarget < Target
|
49
|
-
def initialize( a_alias, &block )
|
50
|
-
super( a_alias )
|
51
|
-
|
52
|
-
instance_eval( &block ) if block
|
53
|
-
end
|
54
|
-
|
55
|
-
def target_type
|
56
|
-
return CompositeTargetType.new
|
57
|
-
end
|
58
|
-
|
59
|
-
def build
|
60
|
-
if nil == @mxx_last_build_result
|
61
|
-
|
62
|
-
if !@mxx_all_options_defined
|
63
|
-
# It's required for toolset to define all required options
|
64
|
-
# taking all current modes into account.
|
65
|
-
MxxRu::Cpp::toolset.setup_mandatory_options( self )
|
66
|
-
@mxx_all_options_defined = true
|
67
|
-
end
|
68
|
-
|
69
|
-
@mxx_last_build_result = build_required_projects
|
70
|
-
end
|
71
|
-
|
72
|
-
return @mxx_last_build_result
|
73
|
-
|
74
|
-
end
|
75
|
-
|
76
|
-
def clean
|
77
|
-
if nil == @mxx_last_build_result
|
78
|
-
|
79
|
-
if !@mxx_all_options_defined
|
80
|
-
# It's required for toolset to define all required options
|
81
|
-
# taking all current modes into account.
|
82
|
-
MxxRu::Cpp::toolset.setup_mandatory_options( self )
|
83
|
-
@mxx_all_options_defined = true
|
84
|
-
end
|
85
|
-
|
86
|
-
clean_required_prjs
|
87
|
-
|
88
|
-
@mxx_last_build_result = MxxRu::TargetState.new(
|
89
|
-
MxxRu::TargetState::ABSENT )
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
def reset
|
94
|
-
reset_required_projects
|
95
|
-
@mxx_last_build_result = nil
|
96
|
-
end
|
97
|
-
|
98
|
-
end # class CompositeTarget
|
99
|
-
|
100
|
-
# For compatibility with previous versions.
|
101
|
-
Composite_target = CompositeTarget
|
102
|
-
|
103
|
-
# Simple method to define composite target.
|
104
|
-
#
|
105
|
-
# Example:
|
106
|
-
# MxxRu::Cpp::composite_target( MxxRu::BUILD_ROOT ) {
|
107
|
-
# required_prj 'some_project.rb'
|
108
|
-
# required_prj 'some_another_project.rb'
|
109
|
-
# }
|
110
|
-
def Cpp.composite_target( prj_alias = nil, &block )
|
111
|
-
prj_alias = MxxRu::Util::prj_alias_form_caller( caller ) unless prj_alias
|
112
|
-
MxxRu::setup_target CompositeTarget.new( prj_alias, &block )
|
113
|
-
end
|
114
|
-
|
115
|
-
end # module Cpp
|
116
|
-
|
117
|
-
end # module MxxRu
|
118
|
-
|
1
|
+
#--
|
2
|
+
# Copyright (c) 1996-2004, Yauheni Akhotnikau
|
3
|
+
# Copyright (c) 2004-2006, JSC Intervale
|
4
|
+
# Copyright (c) 2006, The Mxx_ru Project
|
5
|
+
# All rights reserved.
|
6
|
+
#
|
7
|
+
# Redistribution and use in source and binary forms, with or without modification,
|
8
|
+
# are permitted provided that the following conditions are met:
|
9
|
+
#
|
10
|
+
# 1. Redistributions of source code must retain the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer.
|
12
|
+
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
13
|
+
# this list of conditions and the following disclaimer in the documentation
|
14
|
+
# and/or other materials provided with the distribution.
|
15
|
+
# 3. The name of the author may not be used to endorse or promote products derived
|
16
|
+
# from this software without specific prior written permission.
|
17
|
+
#
|
18
|
+
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
19
|
+
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
20
|
+
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
|
21
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
22
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
23
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
25
|
+
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
26
|
+
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
#++
|
28
|
+
|
29
|
+
require 'mxx_ru/cpp/target'
|
30
|
+
|
31
|
+
module MxxRu
|
32
|
+
|
33
|
+
module Cpp
|
34
|
+
|
35
|
+
# Target type is a composition of subprojects
|
36
|
+
class CompositeTargetType < TargetType
|
37
|
+
TYPE = "composite"
|
38
|
+
|
39
|
+
def name
|
40
|
+
return TYPE
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# For compatibility with previous versions.
|
45
|
+
Composite_target_type = CompositeTargetType
|
46
|
+
|
47
|
+
# Composition of subprojects target
|
48
|
+
class CompositeTarget < Target
|
49
|
+
def initialize( a_alias, &block )
|
50
|
+
super( a_alias )
|
51
|
+
|
52
|
+
instance_eval( &block ) if block
|
53
|
+
end
|
54
|
+
|
55
|
+
def target_type
|
56
|
+
return CompositeTargetType.new
|
57
|
+
end
|
58
|
+
|
59
|
+
def build
|
60
|
+
if nil == @mxx_last_build_result
|
61
|
+
|
62
|
+
if !@mxx_all_options_defined
|
63
|
+
# It's required for toolset to define all required options
|
64
|
+
# taking all current modes into account.
|
65
|
+
MxxRu::Cpp::toolset.setup_mandatory_options( self )
|
66
|
+
@mxx_all_options_defined = true
|
67
|
+
end
|
68
|
+
|
69
|
+
@mxx_last_build_result = build_required_projects
|
70
|
+
end
|
71
|
+
|
72
|
+
return @mxx_last_build_result
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
def clean
|
77
|
+
if nil == @mxx_last_build_result
|
78
|
+
|
79
|
+
if !@mxx_all_options_defined
|
80
|
+
# It's required for toolset to define all required options
|
81
|
+
# taking all current modes into account.
|
82
|
+
MxxRu::Cpp::toolset.setup_mandatory_options( self )
|
83
|
+
@mxx_all_options_defined = true
|
84
|
+
end
|
85
|
+
|
86
|
+
clean_required_prjs
|
87
|
+
|
88
|
+
@mxx_last_build_result = MxxRu::TargetState.new(
|
89
|
+
MxxRu::TargetState::ABSENT )
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
def reset
|
94
|
+
reset_required_projects
|
95
|
+
@mxx_last_build_result = nil
|
96
|
+
end
|
97
|
+
|
98
|
+
end # class CompositeTarget
|
99
|
+
|
100
|
+
# For compatibility with previous versions.
|
101
|
+
Composite_target = CompositeTarget
|
102
|
+
|
103
|
+
# Simple method to define composite target.
|
104
|
+
#
|
105
|
+
# Example:
|
106
|
+
# MxxRu::Cpp::composite_target( MxxRu::BUILD_ROOT ) {
|
107
|
+
# required_prj 'some_project.rb'
|
108
|
+
# required_prj 'some_another_project.rb'
|
109
|
+
# }
|
110
|
+
def Cpp.composite_target( prj_alias = nil, &block )
|
111
|
+
prj_alias = MxxRu::Util::prj_alias_form_caller( caller ) unless prj_alias
|
112
|
+
MxxRu::setup_target CompositeTarget.new( prj_alias, &block )
|
113
|
+
end
|
114
|
+
|
115
|
+
end # module Cpp
|
116
|
+
|
117
|
+
end # module MxxRu
|
118
|
+
|
@@ -1,122 +1,122 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright (c) 1996-2004, Yauheni Akhotnikau
|
3
|
-
# Copyright (c) 2004-2006, JSC Intervale
|
4
|
-
# Copyright (c) 2006, The Mxx_ru Project
|
5
|
-
# All rights reserved.
|
6
|
-
#
|
7
|
-
# Redistribution and use in source and binary forms, with or without modification,
|
8
|
-
# are permitted provided that the following conditions are met:
|
9
|
-
#
|
10
|
-
# 1. Redistributions of source code must retain the above copyright notice,
|
11
|
-
# this list of conditions and the following disclaimer.
|
12
|
-
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
13
|
-
# this list of conditions and the following disclaimer in the documentation
|
14
|
-
# and/or other materials provided with the distribution.
|
15
|
-
# 3. The name of the author may not be used to endorse or promote products derived
|
16
|
-
# from this software without specific prior written permission.
|
17
|
-
#
|
18
|
-
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
19
|
-
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
20
|
-
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
|
21
|
-
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
22
|
-
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
23
|
-
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
-
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
25
|
-
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
26
|
-
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
-
#++
|
28
|
-
|
29
|
-
require 'mxx_ru/cpp/toolset'
|
30
|
-
|
31
|
-
module MxxRu
|
32
|
-
module Cpp
|
33
|
-
|
34
|
-
# Detect current toolset based on values of environment variables
|
35
|
-
#
|
36
|
-
# Following algorithm is used:
|
37
|
-
# Getting the value of MXX_RU_CPP_TOOLSET envonment variable.
|
38
|
-
# It should be in a following format:
|
39
|
-
# <file> [tag=value [tag=value [...]]
|
40
|
-
# <file> value is used in require directive.
|
41
|
-
#
|
42
|
-
# After loading of file defined, toolset method should return
|
43
|
-
# a pointer to toolset object.
|
44
|
-
#
|
45
|
-
# If toolset object was created, pairs of tag=value are parsed and
|
46
|
-
# saved to the toolset created using a setup_tag method.
|
47
|
-
def Cpp.detect_toolset
|
48
|
-
begin
|
49
|
-
env_var = "MXX_RU_CPP_TOOLSET"
|
50
|
-
|
51
|
-
env = ENV[ env_var ]
|
52
|
-
if nil == env
|
53
|
-
raise MxxRu::InvalidValueEx.new(
|
54
|
-
"Environment variable '#{env_var}' not found (not set " +
|
55
|
-
"or empty" )
|
56
|
-
end
|
57
|
-
|
58
|
-
# Exctracting file name, responsible for toolset object creation.
|
59
|
-
toolset_file_name_regexp = /^(\S+)(.*)$/
|
60
|
-
file_name_match = toolset_file_name_regexp.match( env )
|
61
|
-
if nil == file_name_match
|
62
|
-
raise MxxRu::InvalidValueEx.new(
|
63
|
-
"Invalid format of environment variable '#{env_var}'. " +
|
64
|
-
"Expected format: #{env_var}=<file>[ <tag>=<value>[ " +
|
65
|
-
"<tag>=<value>[ ...]]]" )
|
66
|
-
end
|
67
|
-
|
68
|
-
file_name = file_name_match[ 1 ]
|
69
|
-
unparsed_tags = file_name_match[ 2 ]
|
70
|
-
|
71
|
-
# Loading the file
|
72
|
-
# Try to loading specified file first, if it fails try to
|
73
|
-
# loading file with 'mxx_ru/cpp/toolsets' added...
|
74
|
-
try_load_toolset_file file_name
|
75
|
-
|
76
|
-
if nil == toolset()
|
77
|
-
raise MxxRu::InvalidValueEx.new(
|
78
|
-
"C/C++ Toolset is not set by file '#{file_name}'" )
|
79
|
-
end
|
80
|
-
|
81
|
-
# Setting up toolset tags
|
82
|
-
setup_toolset_tags( toolset(), unparsed_tags )
|
83
|
-
|
84
|
-
rescue MxxRu::Ex => ex
|
85
|
-
$stderr.print "<<<[#{ex.class.name}]\t#{ex}>>>\n"
|
86
|
-
exit( -1 )
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
# [_a_toolset_] Toolset, tags are set for
|
91
|
-
# [_a_unparsed_tags_] A string, formatted that way:
|
92
|
-
# <tag>=<value>[ <tag>=<value> [<tag>=<value> ...]]
|
93
|
-
def Cpp.setup_toolset_tags( a_toolset,
|
94
|
-
a_unparsed_tags )
|
95
|
-
|
96
|
-
a_unparsed_tags.scan( /(\S+)=(\S+)/ ) { |t, v|
|
97
|
-
a_toolset.setup_tag( t, v )
|
98
|
-
}
|
99
|
-
|
100
|
-
end
|
101
|
-
|
102
|
-
# Try load toolset file (without and with 'mxx_ru/cpp/toolsets' prefix).
|
103
|
-
#
|
104
|
-
# Raises LoadError if loading failed
|
105
|
-
def Cpp.try_load_toolset_file( file_name )
|
106
|
-
files_to_load = [ file_name,
|
107
|
-
File.join( 'mxx_ru/cpp/toolsets', file_name ) ]
|
108
|
-
load_result = files_to_load.detect { |file_to_load|
|
109
|
-
begin
|
110
|
-
require file_to_load
|
111
|
-
rescue LoadError
|
112
|
-
false
|
113
|
-
end
|
114
|
-
}
|
115
|
-
raise MxxRu::InvalidValueEx.new(
|
116
|
-
"Unable to load Toolset from files: " +
|
117
|
-
"'#{files_to_load.join('; ')}'" ) unless load_result
|
118
|
-
end
|
119
|
-
|
120
|
-
end # module Cpp
|
121
|
-
end # module MxxRu
|
122
|
-
|
1
|
+
#--
|
2
|
+
# Copyright (c) 1996-2004, Yauheni Akhotnikau
|
3
|
+
# Copyright (c) 2004-2006, JSC Intervale
|
4
|
+
# Copyright (c) 2006, The Mxx_ru Project
|
5
|
+
# All rights reserved.
|
6
|
+
#
|
7
|
+
# Redistribution and use in source and binary forms, with or without modification,
|
8
|
+
# are permitted provided that the following conditions are met:
|
9
|
+
#
|
10
|
+
# 1. Redistributions of source code must retain the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer.
|
12
|
+
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
13
|
+
# this list of conditions and the following disclaimer in the documentation
|
14
|
+
# and/or other materials provided with the distribution.
|
15
|
+
# 3. The name of the author may not be used to endorse or promote products derived
|
16
|
+
# from this software without specific prior written permission.
|
17
|
+
#
|
18
|
+
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
19
|
+
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
20
|
+
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
|
21
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
22
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
23
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
25
|
+
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
26
|
+
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
#++
|
28
|
+
|
29
|
+
require 'mxx_ru/cpp/toolset'
|
30
|
+
|
31
|
+
module MxxRu
|
32
|
+
module Cpp
|
33
|
+
|
34
|
+
# Detect current toolset based on values of environment variables
|
35
|
+
#
|
36
|
+
# Following algorithm is used:
|
37
|
+
# Getting the value of MXX_RU_CPP_TOOLSET envonment variable.
|
38
|
+
# It should be in a following format:
|
39
|
+
# <file> [tag=value [tag=value [...]]
|
40
|
+
# <file> value is used in require directive.
|
41
|
+
#
|
42
|
+
# After loading of file defined, toolset method should return
|
43
|
+
# a pointer to toolset object.
|
44
|
+
#
|
45
|
+
# If toolset object was created, pairs of tag=value are parsed and
|
46
|
+
# saved to the toolset created using a setup_tag method.
|
47
|
+
def Cpp.detect_toolset
|
48
|
+
begin
|
49
|
+
env_var = "MXX_RU_CPP_TOOLSET"
|
50
|
+
|
51
|
+
env = ENV[ env_var ]
|
52
|
+
if nil == env
|
53
|
+
raise MxxRu::InvalidValueEx.new(
|
54
|
+
"Environment variable '#{env_var}' not found (not set " +
|
55
|
+
"or empty" )
|
56
|
+
end
|
57
|
+
|
58
|
+
# Exctracting file name, responsible for toolset object creation.
|
59
|
+
toolset_file_name_regexp = /^(\S+)(.*)$/
|
60
|
+
file_name_match = toolset_file_name_regexp.match( env )
|
61
|
+
if nil == file_name_match
|
62
|
+
raise MxxRu::InvalidValueEx.new(
|
63
|
+
"Invalid format of environment variable '#{env_var}'. " +
|
64
|
+
"Expected format: #{env_var}=<file>[ <tag>=<value>[ " +
|
65
|
+
"<tag>=<value>[ ...]]]" )
|
66
|
+
end
|
67
|
+
|
68
|
+
file_name = file_name_match[ 1 ]
|
69
|
+
unparsed_tags = file_name_match[ 2 ]
|
70
|
+
|
71
|
+
# Loading the file
|
72
|
+
# Try to loading specified file first, if it fails try to
|
73
|
+
# loading file with 'mxx_ru/cpp/toolsets' added...
|
74
|
+
try_load_toolset_file file_name
|
75
|
+
|
76
|
+
if nil == toolset()
|
77
|
+
raise MxxRu::InvalidValueEx.new(
|
78
|
+
"C/C++ Toolset is not set by file '#{file_name}'" )
|
79
|
+
end
|
80
|
+
|
81
|
+
# Setting up toolset tags
|
82
|
+
setup_toolset_tags( toolset(), unparsed_tags )
|
83
|
+
|
84
|
+
rescue MxxRu::Ex => ex
|
85
|
+
$stderr.print "<<<[#{ex.class.name}]\t#{ex}>>>\n"
|
86
|
+
exit( -1 )
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# [_a_toolset_] Toolset, tags are set for
|
91
|
+
# [_a_unparsed_tags_] A string, formatted that way:
|
92
|
+
# <tag>=<value>[ <tag>=<value> [<tag>=<value> ...]]
|
93
|
+
def Cpp.setup_toolset_tags( a_toolset,
|
94
|
+
a_unparsed_tags )
|
95
|
+
|
96
|
+
a_unparsed_tags.scan( /(\S+)=(\S+)/ ) { |t, v|
|
97
|
+
a_toolset.setup_tag( t, v )
|
98
|
+
}
|
99
|
+
|
100
|
+
end
|
101
|
+
|
102
|
+
# Try load toolset file (without and with 'mxx_ru/cpp/toolsets' prefix).
|
103
|
+
#
|
104
|
+
# Raises LoadError if loading failed
|
105
|
+
def Cpp.try_load_toolset_file( file_name )
|
106
|
+
files_to_load = [ file_name,
|
107
|
+
File.join( 'mxx_ru/cpp/toolsets', file_name ) ]
|
108
|
+
load_result = files_to_load.detect { |file_to_load|
|
109
|
+
begin
|
110
|
+
require file_to_load
|
111
|
+
rescue LoadError
|
112
|
+
false
|
113
|
+
end
|
114
|
+
}
|
115
|
+
raise MxxRu::InvalidValueEx.new(
|
116
|
+
"Unable to load Toolset from files: " +
|
117
|
+
"'#{files_to_load.join('; ')}'" ) unless load_result
|
118
|
+
end
|
119
|
+
|
120
|
+
end # module Cpp
|
121
|
+
end # module MxxRu
|
122
|
+
|