Mxx_ru 1.6.11 → 1.6.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 697cc2084b112e7ca1cfba8406bed2eb81348381
4
- data.tar.gz: d5f235271c3609516dc81474a69461f0e5215cd7
3
+ metadata.gz: b22a1fe4d06b2b8a537c03680b8b9021882bf59b
4
+ data.tar.gz: 8938721558b2f234f099987b2743ed5139248fd2
5
5
  SHA512:
6
- metadata.gz: ac2ed6842dceedf6a7712aa808f4b4c7d5e583f2cae29a05603428b2cd25dfa1345df1e7c4d51ec65cbff0d457c3e3d3c90d652ab5f0e300b4a8f61fb13e630e
7
- data.tar.gz: d3b1017f16864ebe875a379053f5ac059464adb6d4d45d333385fec3ed3f2e4517a9525a4365ac9c57af2337f092fa855b05d32c4847edf097cbf4e8aa337ab9
6
+ metadata.gz: d5b331516811a910aaf04ac02cd30b2ae5d88edf87bdafd748d8e82ab704ef4823b7a6e7d6acd76c2f13d4bda3cac69b5e6947ad4e907c4e3a4d65c2929d10f3
7
+ data.tar.gz: 09ed8e1dca20eecbf807abd1d59c2e9b8568cbdade6d1c896f6bc1ff6f4598164b77ca79e206c434087c9444dce886883c563ae56991ea7038e6c04f2af10cba
data/bin/mxxruexternals CHANGED
File without changes
data/bin/mxxrugen CHANGED
File without changes
data/lib/mxx_ru/cpp.rb CHANGED
@@ -34,8 +34,10 @@ require 'mxx_ru/cpp/composite'
34
34
  require 'mxx_ru/cpp/lib_collection'
35
35
 
36
36
  require 'mxx_ru/cpp/obj_placements/custom_subdir'
37
+ require 'mxx_ru/cpp/obj_placements/prj_aware_runtime_subdir'
37
38
 
38
39
  require 'mxx_ru/cpp/ext_cmake_project'
39
40
 
40
41
  # Determining which toolset should be used.
41
42
  MxxRu::Cpp::detect_toolset
43
+
@@ -0,0 +1,218 @@
1
+ #--
2
+ # Copyright (c) 1996-2004, Yauheni Akhotnikau
3
+ # Copyright (c) 2004-2006, JSC Intervale
4
+ # Copyright (c) 2006-2016, 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/util'
30
+ require 'mxx_ru/cpp/obj_placement'
31
+ require 'mxx_ru/cpp/target'
32
+
33
+ require 'digest'
34
+
35
+ module MxxRu
36
+
37
+ module Cpp
38
+
39
+ # Since v.1.6.12
40
+ #
41
+ # This class is similar to RuntimeSubdirObjPlacement and
42
+ # ToolsetRuntimeSubdirObjPlacement but stores intermediate files (like
43
+ # object files, compiled resources and so on) in special subfolders.
44
+ #
45
+ # These subfoldes use special naming in forms:
46
+ #
47
+ # <final_path>/_objs/<runtime>/<prj_alias>/<subdir>
48
+ # <final_path>/_objs/<toolset>/<runtime>/<prj_alias>/<subdir>
49
+ #
50
+ # where subdir is created from a path to source file. A path is
51
+ # transformed (all separators like / or :) is changed to _. It
52
+ # means that so_5/rt/impl will be transformed to so_5_rt_impl.
53
+ # If the result is too long it is transformed another time: part
54
+ # of result name will be changed to SHA1 digest. For example a name
55
+ # so_5/disp/prio_one_thread/quoted_round_robin will be transformed to
56
+ # so_5_disp_prio_one_thread_quoted_round_robin and then to
57
+ # so_5__robin-8f160349ec35.
58
+ #
59
+ # Usage example:
60
+ #
61
+ # MxxRu::Cpp::composite_target {
62
+ # global_obj_placement MxxRu::Cpp::PrjAwareRuntimeSubdirObjPlacement.new(
63
+ # # Final resuls going here.
64
+ # 'bin32' )
65
+ #
66
+ # required_prj 'so_5/prj.rb'
67
+ # required_prj 'so_5/prj_s.rb'
68
+ # ...
69
+ # }
70
+ #
71
+ # The directory structure could looks like:
72
+ #
73
+ # bin32/
74
+ # `- _objs/
75
+ # `- release/
76
+ # `- so_5_prj_rb/
77
+ # `- ...
78
+ # `- so_5_prj_s_rb/
79
+ # `- ...
80
+ # `- release/
81
+ #
82
+ # This ObjPlacement also allows to use toolset id in directory structure:
83
+ #
84
+ # MxxRu::Cpp::composite_target {
85
+ # global_obj_placement MxxRu::Cpp::PrjAwareRuntimeSubdirObjPlacement.new(
86
+ # # Final resuls going here.
87
+ # 'bin32',
88
+ # # Enable toolset identification
89
+ # MxxRu::Cpp::PrjAwareRuntimeSubdirObjPlacement::USE_COMPILER_ID )
90
+ #
91
+ # required_prj 'so_5/prj.rb'
92
+ # required_prj 'so_5/prj_s.rb'
93
+ # ...
94
+ # }
95
+ #
96
+ # The directory structure could looks like:
97
+ #
98
+ # bin32/
99
+ # `- _objs/
100
+ # `- gcc_4_8_2__x86_64_w64_mingw32/
101
+ # `- release/
102
+ # `- so_5_prj_rb/
103
+ # `- ...
104
+ # `- so_5_prj_s_rb/
105
+ # `- ...
106
+ # `- gcc_4_8_2__x86_64_w64_mingw32/
107
+ # `- release/
108
+ #
109
+ class PrjAwareRuntimeSubdirObjPlacement < MxxRu::Cpp::ObjPlacement
110
+ USE_COMPILER_ID = true
111
+ DO_NOT_USE_COMPILER_ID = false
112
+
113
+ # Constructor
114
+ def initialize( final_results_path, use_compiler_id = DO_NOT_USE_COMPILER_ID )
115
+ @final_results_path = final_results_path
116
+ @intermediate_path = File.join( @final_results_path, '_objs' )
117
+ @use_compiler_id = use_compiler_id
118
+ end
119
+
120
+ # Make name for obj file.
121
+ def get_obj( source_path_name, toolset, target )
122
+ root_path = USE_COMPILER_ID == @use_compiler_id ?
123
+ File.join( @intermediate_path, toolset.make_identification_string ) :
124
+ @intermediate_path
125
+
126
+ target_tmps = create_target_tmps_name( target )
127
+ result = if source_path_name &&
128
+ "" != source_path_name &&
129
+ "." != source_path_name
130
+ File.join( root_path, runtime_mode_path( target ), target_tmps,
131
+ transform_path( source_path_name ) )
132
+ else
133
+ File.join( root_path, target_tmps, runtime_mode_path( target ) )
134
+ end
135
+
136
+ MxxRu::Util.ensure_path_exists( result )
137
+
138
+ result
139
+ end
140
+
141
+ # Returns result of get_obj method.
142
+ def get_mswin_res( source_path_name, toolset, target )
143
+ get_obj( source_path_name, toolset, target )
144
+ end
145
+
146
+ # Returns final_results_path
147
+ def get_lib( source_path_name, toolset, target )
148
+ final_result_path_component( source_path_name, toolset, target )
149
+ end
150
+
151
+ # Returns final_results_path
152
+ def get_dll( source_path_name, toolset, target )
153
+ final_result_path_component( source_path_name, toolset, target )
154
+ end
155
+
156
+ # Returns final_results_path
157
+ def get_exe( source_path_name, toolset, target )
158
+ final_result_path_component( source_path_name, toolset, target )
159
+ end
160
+
161
+ protected
162
+ # Make final_results_path if needed and return name of it
163
+ def final_result_path_component( target_root, toolset, target )
164
+ root_path = USE_COMPILER_ID == @use_compiler_id ?
165
+ File.join( @final_results_path, toolset.make_identification_string ) :
166
+ @final_results_path
167
+
168
+ result = if target_root &&
169
+ "" != target_root &&
170
+ "." != target_root
171
+ File.join( root_path, runtime_mode_path( target ), target_root )
172
+ else
173
+ File.join( root_path, runtime_mode_path( target ) )
174
+ end
175
+
176
+ MxxRu::Util.ensure_path_exists( result )
177
+
178
+ result
179
+ end
180
+
181
+ # Returns folder name, which is used for target's runtime mode.
182
+ #
183
+ # [_a_target_] Target, actions are performed for.
184
+ def runtime_mode_path( a_target )
185
+ case a_target.mxx_runtime_mode
186
+ when MxxRu::Cpp::RUNTIME_DEBUG
187
+ return 'debug'
188
+
189
+ when MxxRu::Cpp::RUNTIME_RELEASE
190
+ return 'release'
191
+
192
+ else
193
+ return 'default'
194
+ end
195
+ end
196
+
197
+ def transform_path( path )
198
+ normalized_value = path.gsub( /[\\\/\.:]/, '_' )
199
+ if 24 < normalized_value.size
200
+ r = normalized_value[ 0..3 ] + '__' + normalized_value[ -5..-1 ] + '-' +
201
+ Digest::SHA1.new.update(normalized_value).hexdigest[ 0..11 ]
202
+ normalized_value = r
203
+ end
204
+ normalized_value
205
+ end
206
+
207
+ def create_target_tmps_name( target )
208
+ transform_path( target.prj_alias )
209
+ end
210
+
211
+ end # class PrjAwareRuntimeSubdirObjPlacement
212
+
213
+ end # module Cpp
214
+
215
+ end # module MxxRu
216
+
217
+ # vim:ts=2:sts=2:sw=2:expandtab
218
+
@@ -34,7 +34,7 @@ MxxRu::hg_externals :extname do |e|
34
34
  # Stub for externals from Subversion.
35
35
  =begin
36
36
  MxxRu::svn_externals :extname do |e|
37
- e.url 'https://..." # URL to Svn repository.
37
+ e.url 'https://...' # URL to Svn repository.
38
38
 
39
39
  # Some useful defaults.
40
40
  e.option '-q'
@@ -50,7 +50,7 @@ end
50
50
  # Stub for externals from some downloadable archive.
51
51
  =begin
52
52
  MxxRu::arch_externals :soci do |e|
53
- e.url 'http://..." # URL to archive with source code.
53
+ e.url 'http://...' # URL to archive with source code.
54
54
 
55
55
  e.map_dir 'src-dir' => 'dest-dir'
56
56
 
@@ -34,4 +34,4 @@
34
34
  #
35
35
  # puts 'Mxx_ru version is: ' + MXX_RU_VERSION
36
36
  #
37
- MXX_RU_VERSION = '1.6.11'
37
+ MXX_RU_VERSION = '1.6.12'
@@ -0,0 +1,3 @@
1
+ #include <cstdio>
2
+
3
+ void A() { std::printf( "A2\n" ); }
@@ -0,0 +1,122 @@
1
+ require 'test/unit'
2
+ require 'fileutils'
3
+
4
+ require 'mxx_ru/cpp/obj_placements/prj_aware_runtime_subdir'
5
+
6
+ class TC_PrjAwareRuntimeSubdirObjPlacement < Test::Unit::TestCase
7
+ FINAL_PATH = 'bin'
8
+
9
+ class DummyTarget
10
+ attr_reader :prj_alias
11
+ attr_reader :mxx_runtime_mode
12
+ def initialize(a_alias, a_runtime)
13
+ @prj_alias = a_alias
14
+ @mxx_runtime_mode = a_runtime
15
+ end
16
+ end
17
+
18
+ class DummyToolset
19
+ def make_identification_string
20
+ 'dummy_toolset'
21
+ end
22
+ end
23
+
24
+ def teardown
25
+ FileUtils.rm_r( FINAL_PATH ) if File.directory?( FINAL_PATH )
26
+ end
27
+
28
+ def test_final_path_no_toolset_name
29
+ target = DummyTarget.new( 'some/prj.rb', MxxRu::Cpp::RUNTIME_RELEASE )
30
+ toolset = DummyToolset.new
31
+
32
+ p = MxxRu::Cpp::PrjAwareRuntimeSubdirObjPlacement.new( FINAL_PATH )
33
+
34
+ expected_part = '/release'
35
+
36
+ r = p.get_exe( '', toolset, target )
37
+ check_name_and_path( FINAL_PATH + expected_part, r )
38
+ r = p.get_exe( 'exe', toolset, target )
39
+ check_name_and_path( FINAL_PATH + expected_part + '/exe', r )
40
+
41
+ r = p.get_dll( '', toolset, target )
42
+ check_name_and_path( FINAL_PATH + expected_part, r )
43
+ r = p.get_dll( 'dll', toolset, target )
44
+ check_name_and_path( FINAL_PATH + expected_part + '/dll', r )
45
+
46
+ r = p.get_lib( '', toolset, target )
47
+ check_name_and_path( FINAL_PATH + expected_part, r )
48
+ r = p.get_lib( 'lib', toolset, target )
49
+ check_name_and_path( FINAL_PATH + expected_part + '/lib', r )
50
+ end
51
+
52
+ def test_final_path_with_toolset_name
53
+ target = DummyTarget.new( 'some/prj.rb', MxxRu::Cpp::RUNTIME_DEBUG )
54
+ toolset = DummyToolset.new
55
+
56
+ p = MxxRu::Cpp::PrjAwareRuntimeSubdirObjPlacement.new( FINAL_PATH,
57
+ MxxRu::Cpp::PrjAwareRuntimeSubdirObjPlacement::USE_COMPILER_ID )
58
+
59
+ expected_part = '/dummy_toolset/debug'
60
+
61
+ r = p.get_exe( '', toolset, target )
62
+ check_name_and_path( FINAL_PATH + expected_part, r )
63
+ r = p.get_exe( 'exe', toolset, target )
64
+ check_name_and_path( FINAL_PATH + expected_part + '/exe', r )
65
+
66
+ r = p.get_dll( '', toolset, target )
67
+ check_name_and_path( FINAL_PATH + expected_part, r )
68
+ r = p.get_dll( 'dll', toolset, target )
69
+ check_name_and_path( FINAL_PATH + expected_part + '/dll', r )
70
+
71
+ r = p.get_lib( '', toolset, target )
72
+ check_name_and_path( FINAL_PATH + expected_part, r )
73
+ r = p.get_lib( 'lib', toolset, target )
74
+ check_name_and_path( FINAL_PATH + expected_part + '/lib', r )
75
+ end
76
+
77
+ def test_intermediate_path_no_toolset_name
78
+ target = DummyTarget.new( 'some/prj.rb', MxxRu::Cpp::RUNTIME_RELEASE )
79
+ toolset = DummyToolset.new
80
+
81
+ p = MxxRu::Cpp::PrjAwareRuntimeSubdirObjPlacement.new( FINAL_PATH )
82
+
83
+ expected_part = '/_objs/release/some_prj_rb'
84
+
85
+ =begin
86
+ r = p.get_obj( '', toolset, target )
87
+ check_name_and_path( FINAL_PATH + expected_part, r )
88
+
89
+ r = p.get_obj( '.', toolset, target )
90
+ check_name_and_path( FINAL_PATH + expected_part, r )
91
+ =end
92
+
93
+ r = p.get_obj( 'prj_1/src', toolset, target )
94
+ check_name_and_path( FINAL_PATH + expected_part + '/prj_1_src', r )
95
+
96
+ r = p.get_obj( 'some/very/long/path/to/src/file', toolset, target )
97
+ check_name_and_path( FINAL_PATH + expected_part + '/some___file-3caf2536e0e7', r )
98
+ end
99
+
100
+ def test_intermediate_path_with_toolset_name
101
+ target = DummyTarget.new( 'some/prj.rb', MxxRu::Cpp::RUNTIME_DEBUG )
102
+ toolset = DummyToolset.new
103
+
104
+ p = MxxRu::Cpp::PrjAwareRuntimeSubdirObjPlacement.new( FINAL_PATH,
105
+ MxxRu::Cpp::PrjAwareRuntimeSubdirObjPlacement::USE_COMPILER_ID )
106
+
107
+ expected_part = '/_objs/dummy_toolset/debug/some_prj_rb'
108
+
109
+ r = p.get_obj( 'prj_1/src', toolset, target )
110
+ check_name_and_path( FINAL_PATH + expected_part + '/prj_1_src', r )
111
+
112
+ r = p.get_obj( 'some/very/long/path/to/src/file', toolset, target )
113
+ check_name_and_path( FINAL_PATH + expected_part + '/some___file-3caf2536e0e7', r )
114
+ end
115
+
116
+ private
117
+ def check_name_and_path( expected, actual )
118
+ assert_equal( expected, actual )
119
+ assert( File.directory?( expected ) )
120
+ end
121
+ end
122
+
Binary file
Binary file
File without changes
@@ -0,0 +1,2 @@
1
+ A::A [static]
2
+ A::~A [static]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Mxx_ru
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.11
4
+ version: 1.6.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Mxx_ru Project
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-25 00:00:00.000000000 Z
11
+ date: 2016-08-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Mxx_ru is a cross-platform build tool primarily focused to C/C++ projects
14
14
  email: eao197@yahoo.com
@@ -86,6 +86,7 @@ files:
86
86
  - lib/mxx_ru/cpp/mode.rb
87
87
  - lib/mxx_ru/cpp/obj_placement.rb
88
88
  - lib/mxx_ru/cpp/obj_placements/custom_subdir.rb
89
+ - lib/mxx_ru/cpp/obj_placements/prj_aware_runtime_subdir.rb
89
90
  - lib/mxx_ru/cpp/qt.rb
90
91
  - lib/mxx_ru/cpp/qt4.rb
91
92
  - lib/mxx_ru/cpp/qt4_via_pkg_config.rb
@@ -167,6 +168,7 @@ files:
167
168
  - tests/cpp/custom_target_prefix/dll.cpp
168
169
  - tests/cpp/custom_target_prefix/dll.rb
169
170
  - tests/cpp/custom_target_prefix/tc_custom_target_prefix.rb
171
+ - tests/cpp/lib_from_lib_dependecies/a.cpp
170
172
  - tests/cpp/lib_from_lib_dependecies/a.rb
171
173
  - tests/cpp/lib_from_lib_dependecies/b.cpp
172
174
  - tests/cpp/lib_from_lib_dependecies/b.rb
@@ -291,6 +293,7 @@ files:
291
293
  - tests/mxx_ru/lib_path/main.rb
292
294
  - tests/mxx_ru/lib_path/tc_lib_path.rb
293
295
  - tests/mxx_ru/obj_placements/tc_custom_subdir.rb
296
+ - tests/mxx_ru/obj_placements/tc_prj_aware_runtime_subdir.rb
294
297
  - tests/mxx_ru/opt_lib_ext/build.rb
295
298
  - tests/mxx_ru/opt_lib_ext/hi.c
296
299
  - tests/mxx_ru/opt_lib_ext/hi.h
@@ -334,22 +337,33 @@ files:
334
337
  - tests/unix/lib_linking_mode/a_static.rb
335
338
  - tests/unix/lib_linking_mode/etalon/shared.txt
336
339
  - tests/unix/lib_linking_mode/etalon/static.txt
340
+ - tests/unix/lib_linking_mode/liba.a
341
+ - tests/unix/lib_linking_mode/liba.so
337
342
  - tests/unix/lib_linking_mode/main.impl.cpp
338
343
  - tests/unix/lib_linking_mode/main_conflict.cpp
339
344
  - tests/unix/lib_linking_mode/main_conflict.rb
340
345
  - tests/unix/lib_linking_mode/main_conflict_2.rb
346
+ - tests/unix/lib_linking_mode/main_shared
341
347
  - tests/unix/lib_linking_mode/main_shared.cpp
342
348
  - tests/unix/lib_linking_mode/main_shared.rb
343
349
  - tests/unix/lib_linking_mode/main_shared.ut.rb
344
350
  - tests/unix/lib_linking_mode/main_shared_2.cpp
345
351
  - tests/unix/lib_linking_mode/main_shared_2.rb
346
352
  - tests/unix/lib_linking_mode/main_shared_2.ut.rb
353
+ - tests/unix/lib_linking_mode/main_static
347
354
  - tests/unix/lib_linking_mode/main_static.cpp
348
355
  - tests/unix/lib_linking_mode/main_static.rb
349
356
  - tests/unix/lib_linking_mode/main_static.ut.rb
350
357
  - tests/unix/lib_linking_mode/main_static_2.cpp
351
358
  - tests/unix/lib_linking_mode/main_static_2.rb
352
359
  - tests/unix/lib_linking_mode/main_static_2.ut.rb
360
+ - tests/unix/lib_linking_mode/o/a_shared.o
361
+ - tests/unix/lib_linking_mode/o/a_static.o
362
+ - tests/unix/lib_linking_mode/o/main_conflict.o
363
+ - tests/unix/lib_linking_mode/o/main_shared.o
364
+ - tests/unix/lib_linking_mode/o/main_static.o
365
+ - tests/unix/lib_linking_mode/out/shared.txt
366
+ - tests/unix/lib_linking_mode/out/static.txt
353
367
  - tests/unix/lib_linking_mode/tc_conflicted_build.rb
354
368
  - tests/unix/lib_linking_mode/tc_normal_build.rb
355
369
  - tests/unix/lib_order/a.cpp
@@ -390,7 +404,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
390
404
  version: '0'
391
405
  requirements: []
392
406
  rubyforge_project:
393
- rubygems_version: 2.2.2
407
+ rubygems_version: 2.5.1
394
408
  signing_key:
395
409
  specification_version: 4
396
410
  summary: Mxx_ru (Make++ on Ruby) is a cross-platform build tool