Mxx_ru 1.5.6 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/NEWS +17 -0
- data/examples/exe_dll_lib_3/build.rb +10 -0
- data/examples/exe_dll_lib_3/inout/inout.cpp +25 -0
- data/examples/exe_dll_lib_3/inout/inout.hpp +18 -0
- data/examples/exe_dll_lib_3/inout/prj.rb +11 -0
- data/examples/exe_dll_lib_3/log/log.cpp +38 -0
- data/examples/exe_dll_lib_3/log/log.hpp +30 -0
- data/examples/exe_dll_lib_3/log/prj.rb +20 -0
- data/examples/exe_dll_lib_3/logic/logic.cpp +10 -0
- data/examples/exe_dll_lib_3/logic/logic.hpp +8 -0
- data/examples/exe_dll_lib_3/logic/prj.rb +11 -0
- data/examples/exe_dll_lib_3/main/main.cpp +52 -0
- data/examples/exe_dll_lib_3/main/prj.rb +15 -0
- data/examples/exe_dll_lib_3/math/math.cpp +7 -0
- data/examples/exe_dll_lib_3/math/math.hpp +8 -0
- data/examples/exe_dll_lib_3/math/prj.rb +9 -0
- data/examples/exe_dll_lib_3/say/prj.rb +18 -0
- data/examples/exe_dll_lib_3/say/say.cpp +33 -0
- data/examples/exe_dll_lib_3/say/say.hpp +37 -0
- data/lib/mxx_ru/cpp/analyzer.rb +1 -1
- data/lib/mxx_ru/cpp/detect_toolset.rb +2 -0
- data/lib/mxx_ru/cpp/toolset.rb +2 -0
- data/lib/mxx_ru/cpp/toolsets/clang_family.rb +159 -0
- data/lib/mxx_ru/cpp/toolsets/clang_linux.rb +55 -0
- data/lib/mxx_ru/cpp/toolsets/gcc_family.rb +0 -2
- data/lib/mxx_ru/cpp/toolsets/gcc_unix_family.rb +8 -0
- data/lib/mxx_ru/cpp/toolsets/vc11.rb +58 -0
- data/lib/mxx_ru/util.rb +2 -2
- data/lib/mxx_ru/version.rb +1 -1
- metadata +24 -3
data/NEWS
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
Changes in Mxx_ru
|
2
2
|
|
3
|
+
1.6.0 version (2013.05.17)
|
4
|
+
|
5
|
+
mxx_ru/cpp/toolsets/vc11.rb file was added to support
|
6
|
+
Microsoft Visual Studio 2012 C++ compiler.
|
7
|
+
|
8
|
+
Clang toolsets family added.
|
9
|
+
|
10
|
+
mxx_ru/cpp/toolsets/clang_linux.rb file was added to support
|
11
|
+
clang compiler on linux platform.
|
12
|
+
|
13
|
+
Fixed incompatibilities with Ruby 1.9.1
|
14
|
+
|
15
|
+
Fixed problem with linkage under some versions of g++: order of used static libs matters even though '-Wl,--start-group' and ' -Wl,--end-group' params ARE used.
|
16
|
+
|
17
|
+
Fixes at GccFamily toolsets build options: option -fPIC moved from GccFamily to
|
18
|
+
GccUnixFamily toolset options for compatibility with GccMswinFamily.
|
19
|
+
|
3
20
|
1.5.6 version (2012.09.10)
|
4
21
|
|
5
22
|
Method Cpp::Target#source_encoding for setting default encoding source files was added.
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#include <say/say.hpp>
|
2
|
+
#include <math/math.hpp>
|
3
|
+
|
4
|
+
#include <inout/inout.hpp>
|
5
|
+
|
6
|
+
inout_t::inout_t(
|
7
|
+
const std::string & method,
|
8
|
+
int arg_to_square )
|
9
|
+
: m_method( method )
|
10
|
+
{
|
11
|
+
say_type_t say( m_method );
|
12
|
+
|
13
|
+
say.say( std::cout , "hello" );
|
14
|
+
|
15
|
+
std::cout << "square of " <<
|
16
|
+
arg_to_square << " is " <<
|
17
|
+
square( arg_to_square ) << std::endl;
|
18
|
+
}
|
19
|
+
|
20
|
+
inout_t::~inout_t()
|
21
|
+
{
|
22
|
+
say_type_t say( m_method );
|
23
|
+
|
24
|
+
say.say( std::cout , "bye" );
|
25
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#if !defined( _INOUT_HPP_ )
|
2
|
+
#define _INOUT_HPP_
|
3
|
+
|
4
|
+
#include <string>
|
5
|
+
|
6
|
+
class inout_t
|
7
|
+
{
|
8
|
+
public :
|
9
|
+
inout_t(
|
10
|
+
const std::string & method,
|
11
|
+
int arg_to_square );
|
12
|
+
~inout_t();
|
13
|
+
|
14
|
+
private :
|
15
|
+
std::string m_method;
|
16
|
+
};
|
17
|
+
|
18
|
+
#endif
|
@@ -0,0 +1,38 @@
|
|
1
|
+
#include <say/say.hpp>
|
2
|
+
|
3
|
+
#include <log/log.hpp>
|
4
|
+
|
5
|
+
|
6
|
+
/*
|
7
|
+
void
|
8
|
+
say_hello( std::ostream & to, const std::string & where )
|
9
|
+
{
|
10
|
+
to << where << ": Hello!" << std::endl;
|
11
|
+
}
|
12
|
+
|
13
|
+
void
|
14
|
+
say_bye( std::ostream & to, const std::string & where )
|
15
|
+
{
|
16
|
+
to << where << ": Bye!" << std::endl;
|
17
|
+
}
|
18
|
+
|
19
|
+
*/
|
20
|
+
|
21
|
+
log_type_t::log_type_t( const std::string & method )
|
22
|
+
:
|
23
|
+
m_method( method )
|
24
|
+
{
|
25
|
+
}
|
26
|
+
|
27
|
+
log_type_t::~log_type_t()
|
28
|
+
{
|
29
|
+
}
|
30
|
+
|
31
|
+
void
|
32
|
+
log_type_t::log() const
|
33
|
+
{
|
34
|
+
say_type_t say( m_method );
|
35
|
+
|
36
|
+
say.say( std::cout , "log" );
|
37
|
+
}
|
38
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
#if !defined( _LOG_HPP_ )
|
2
|
+
#define _LOG_HPP_
|
3
|
+
|
4
|
+
#include <iostream>
|
5
|
+
#include <string>
|
6
|
+
|
7
|
+
#if defined( LOG_MSWIN )
|
8
|
+
#if defined( LOG_PRJ )
|
9
|
+
#define LOG_TYPE __declspec(dllexport)
|
10
|
+
#else
|
11
|
+
#define LOG_TYPE __declspec(dllimport)
|
12
|
+
#endif
|
13
|
+
#else
|
14
|
+
#define LOG_TYPE
|
15
|
+
#endif
|
16
|
+
|
17
|
+
class LOG_TYPE log_type_t
|
18
|
+
{
|
19
|
+
public :
|
20
|
+
log_type_t( const std::string & method );
|
21
|
+
~log_type_t();
|
22
|
+
|
23
|
+
void
|
24
|
+
log() const;
|
25
|
+
|
26
|
+
private :
|
27
|
+
std::string m_method;
|
28
|
+
};
|
29
|
+
|
30
|
+
#endif
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'mxx_ru/cpp'
|
2
|
+
|
3
|
+
MxxRu::Cpp::dll_target {
|
4
|
+
|
5
|
+
rtl_mode( Mxx_ru::Cpp::RTL_SHARED )
|
6
|
+
|
7
|
+
required_prj( "say/prj.rb" )
|
8
|
+
|
9
|
+
target( "log" )
|
10
|
+
implib_path( "lib" )
|
11
|
+
|
12
|
+
define( "LOG_PRJ" )
|
13
|
+
|
14
|
+
if "mswin" == toolset.tag( "target_os" )
|
15
|
+
define( "LOG_MSWIN" )
|
16
|
+
end
|
17
|
+
|
18
|
+
cpp_source( "log.cpp" )
|
19
|
+
}
|
20
|
+
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#include <iostream>
|
2
|
+
|
3
|
+
#include <inout/inout.hpp>
|
4
|
+
|
5
|
+
#include <log/log.hpp>
|
6
|
+
|
7
|
+
#include <logic/logic.hpp>
|
8
|
+
|
9
|
+
#include <math/math.hpp>
|
10
|
+
|
11
|
+
void
|
12
|
+
some_func()
|
13
|
+
{
|
14
|
+
inout_t braces( "some_func" , 2);
|
15
|
+
|
16
|
+
std::cout << "Some functionality..." << std::endl;
|
17
|
+
}
|
18
|
+
|
19
|
+
void
|
20
|
+
table_of_squares()
|
21
|
+
{
|
22
|
+
std::cout << "table of squares: " << std::endl;
|
23
|
+
for( int i = 1 ; i < 6 ; ++i )
|
24
|
+
std::cout << i << "--" << square( i ) << "\n";
|
25
|
+
std::cout << std::endl;
|
26
|
+
}
|
27
|
+
|
28
|
+
void
|
29
|
+
circle( int radius )
|
30
|
+
{
|
31
|
+
std::cout << "square of circle with radius " <<
|
32
|
+
radius << " is " << square_of_circle( radius ) << std::endl;
|
33
|
+
}
|
34
|
+
|
35
|
+
int
|
36
|
+
main()
|
37
|
+
{
|
38
|
+
inout_t braces( "main" , 1 );
|
39
|
+
|
40
|
+
std::cout << "Exe, dll, lib main..." << std::endl;
|
41
|
+
|
42
|
+
some_func();
|
43
|
+
|
44
|
+
log_type_t logger( "main" );
|
45
|
+
logger.log();
|
46
|
+
|
47
|
+
circle( 5 );
|
48
|
+
|
49
|
+
table_of_squares();
|
50
|
+
|
51
|
+
return 0;
|
52
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'mxx_ru/cpp'
|
2
|
+
|
3
|
+
MxxRu::Cpp::exe_target {
|
4
|
+
target( "exe_dll_lib" )
|
5
|
+
|
6
|
+
required_prj( "log/prj.rb" )
|
7
|
+
|
8
|
+
required_prj( "inout/prj.rb" )
|
9
|
+
|
10
|
+
required_prj( "logic/prj.rb" )
|
11
|
+
|
12
|
+
required_prj( "math/prj.rb" )
|
13
|
+
|
14
|
+
cpp_source( "main.cpp" )
|
15
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'mxx_ru/cpp'
|
2
|
+
|
3
|
+
MxxRu::Cpp::dll_target {
|
4
|
+
|
5
|
+
rtl_mode( Mxx_ru::Cpp::RTL_SHARED )
|
6
|
+
|
7
|
+
target( "say" )
|
8
|
+
implib_path( "lib" )
|
9
|
+
|
10
|
+
define( "SAY_PRJ" )
|
11
|
+
|
12
|
+
if "mswin" == toolset.tag( "target_os" )
|
13
|
+
define( "SAY_MSWIN" )
|
14
|
+
end
|
15
|
+
|
16
|
+
cpp_source( "say.cpp" )
|
17
|
+
}
|
18
|
+
#=end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#include <say/say.hpp>
|
2
|
+
|
3
|
+
/*
|
4
|
+
void
|
5
|
+
say_hello( std::ostream & to, const std::string & where )
|
6
|
+
{
|
7
|
+
to << where << ": Hello!" << std::endl;
|
8
|
+
}
|
9
|
+
|
10
|
+
void
|
11
|
+
say_bye( std::ostream & to, const std::string & where )
|
12
|
+
{
|
13
|
+
to << where << ": Bye!" << std::endl;
|
14
|
+
}
|
15
|
+
|
16
|
+
*/
|
17
|
+
|
18
|
+
say_type_t::say_type_t( const std::string & method )
|
19
|
+
:
|
20
|
+
m_method( method )
|
21
|
+
{
|
22
|
+
}
|
23
|
+
|
24
|
+
say_type_t::~say_type_t()
|
25
|
+
{
|
26
|
+
}
|
27
|
+
|
28
|
+
void
|
29
|
+
say_type_t::say( std::ostream & to , const std::string & what ) const
|
30
|
+
{
|
31
|
+
to << m_method << ":" << what << std::endl;
|
32
|
+
}
|
33
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#if !defined( _SAY_HPP_ )
|
2
|
+
#define _SAY_HPP_
|
3
|
+
|
4
|
+
#include <iostream>
|
5
|
+
#include <string>
|
6
|
+
|
7
|
+
#if defined( SAY_MSWIN )
|
8
|
+
#if defined( SAY_PRJ )
|
9
|
+
#define SAY_TYPE __declspec(dllexport)
|
10
|
+
#else
|
11
|
+
#define SAY_TYPE __declspec(dllimport)
|
12
|
+
#endif
|
13
|
+
#else
|
14
|
+
#define SAY_TYPE
|
15
|
+
#endif
|
16
|
+
|
17
|
+
/*
|
18
|
+
void
|
19
|
+
say_hello( std::ostream & to, const std::string & where );
|
20
|
+
void
|
21
|
+
say_bye( std::ostream & to, const std::string & where );
|
22
|
+
*/
|
23
|
+
|
24
|
+
class SAY_TYPE say_type_t
|
25
|
+
{
|
26
|
+
public :
|
27
|
+
say_type_t( const std::string & method );
|
28
|
+
~say_type_t();
|
29
|
+
|
30
|
+
void
|
31
|
+
say( std::ostream & to , const std::string & what ) const;
|
32
|
+
|
33
|
+
private :
|
34
|
+
std::string m_method;
|
35
|
+
};
|
36
|
+
|
37
|
+
#endif
|
data/lib/mxx_ru/cpp/analyzer.rb
CHANGED
@@ -150,7 +150,7 @@ module MxxRu
|
|
150
150
|
# Gather file names list from include directives.
|
151
151
|
std_path_included = Array.new
|
152
152
|
local_path_included = Array.new
|
153
|
-
IO.foreach( a_file_name , encoding: a_encoding ) { |line|
|
153
|
+
IO.foreach( a_file_name , encoding: "#{a_encoding}" ) { |line|
|
154
154
|
r = @@include_regex.match( line )
|
155
155
|
if nil != r
|
156
156
|
if "<" == r[ 1 ]
|
data/lib/mxx_ru/cpp/toolset.rb
CHANGED
@@ -0,0 +1,159 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 1996-2004, Yauheni Akhotnikau
|
3
|
+
# Copyright (c) 2004-2006, JSC Intervale
|
4
|
+
# Copyright (c) 2006-2011, 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/binary_library'
|
30
|
+
require 'mxx_ru/cpp/toolsets/gcc_family'
|
31
|
+
|
32
|
+
module MxxRu
|
33
|
+
module Cpp
|
34
|
+
module Toolsets
|
35
|
+
|
36
|
+
# Toolset implemetation for Clang compiler.
|
37
|
+
class ClangFamily < GccFamily
|
38
|
+
public
|
39
|
+
|
40
|
+
def initialize( name )
|
41
|
+
super( name )
|
42
|
+
end
|
43
|
+
|
44
|
+
# See description at MxxRu::Cpp::Toolset#setup_mandatory_options.
|
45
|
+
def setup_mandatory_options( target )
|
46
|
+
|
47
|
+
if RUNTIME_DEBUG == target.mxx_runtime_mode
|
48
|
+
target.compiler_option( "-g" )
|
49
|
+
target.linker_option( "-g" )
|
50
|
+
elsif RUNTIME_RELEASE == target.mxx_runtime_mode
|
51
|
+
target.define( "NDEBUG" )
|
52
|
+
target.linker_option( "-s" )
|
53
|
+
if OPTIM_SIZE == target.mxx_optimization
|
54
|
+
target.compiler_option( "-Os" )
|
55
|
+
else
|
56
|
+
target.compiler_option( "-O2" )
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
if RTTI_DISABLED == target.mxx_rtti_mode
|
61
|
+
target.cpp_compiler_option( "-fno-rtti" )
|
62
|
+
end
|
63
|
+
|
64
|
+
target.compiler_option( "-fPIC" )
|
65
|
+
|
66
|
+
target.mxx_all_defines.each { |d|
|
67
|
+
target.compiler_option( "-D" + d )
|
68
|
+
}
|
69
|
+
|
70
|
+
target.mxx_all_include_paths.each { |p|
|
71
|
+
target.compiler_option( "-I" + p )
|
72
|
+
}
|
73
|
+
|
74
|
+
if true == @is_cpp0x_std
|
75
|
+
target.cpp_compiler_option( "-std=c++0x" )
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# Returns C compiler name.
|
80
|
+
def c_compiler_name
|
81
|
+
tag( [ C_COMPILER_NAME_TAG, COMPILER_NAME_TAG ], "clang" )
|
82
|
+
end
|
83
|
+
|
84
|
+
# Returns C++ compiler name.
|
85
|
+
def cpp_compiler_name
|
86
|
+
tag( [ CPP_COMPILER_NAME_TAG, COMPILER_NAME_TAG ], "clang++" )
|
87
|
+
end
|
88
|
+
|
89
|
+
# Returns linker name.
|
90
|
+
def linker_name
|
91
|
+
tag( LINKER_NAME_TAG, "clang++" )
|
92
|
+
end
|
93
|
+
|
94
|
+
# Returns librarian name.
|
95
|
+
def librarian_name
|
96
|
+
tag( LIBRARIAN_NAME_TAG, "ar" )
|
97
|
+
end
|
98
|
+
|
99
|
+
# Special implementation for support explicit library type linker option.
|
100
|
+
def make_linker_include_lib_options( target, libs )
|
101
|
+
current_lib_type = nil
|
102
|
+
all_libs = libs.inject( '' ) { |r, l|
|
103
|
+
# Insert new lib mode switch only if next library has different
|
104
|
+
# type than current type.
|
105
|
+
if nil == current_lib_type || current_lib_type != l.type
|
106
|
+
r << switch_to_default_lib_mode_if_needed( current_lib_type )
|
107
|
+
current_lib_type = l.type
|
108
|
+
if BinaryLibrary::ANY != l.type &&
|
109
|
+
default_lib_linking_mode != l.type
|
110
|
+
r << lib_linking_mode_switch( l.type )
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
r << '-l' << port_specific_lib_name_checker( l.name ) << ' '
|
115
|
+
}
|
116
|
+
all_libs << switch_to_default_lib_mode_if_needed( current_lib_type )
|
117
|
+
enclose_linker_include_lib_options_into_brackes( all_libs )
|
118
|
+
end
|
119
|
+
|
120
|
+
|
121
|
+
# Return default library linking mode for current platform.
|
122
|
+
#
|
123
|
+
# Default mode BinaryLibrary::SHARED for Unix with GCC assumed.
|
124
|
+
# But default mode can be specified in toolset tag 'lib_linking_mode'.
|
125
|
+
def default_lib_linking_mode
|
126
|
+
t = tag( 'lib_linking_mode', 'unknown' )
|
127
|
+
if 'unknown' != t
|
128
|
+
'static' == t ? BinaryLibrary::STATIC : BinaryLibrary::SHARED
|
129
|
+
else
|
130
|
+
BinaryLibrary::SHARED
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
# Return command line switch for forcing specified library type.
|
135
|
+
def lib_linking_mode_switch( linking_mode )
|
136
|
+
"-Wl,#{linking_mode == BinaryLibrary::SHARED ? '-Bdynamic' : '-Bstatic'} "
|
137
|
+
end
|
138
|
+
|
139
|
+
# Return command line switch for closing group of libraries with same type.
|
140
|
+
# Empty string returned if current_lib_type is nil of is current_lib_type
|
141
|
+
# is default lib linking mode on this platform.
|
142
|
+
def switch_to_default_lib_mode_if_needed( current_lib_type )
|
143
|
+
if nil != current_lib_type &&
|
144
|
+
BinaryLibrary::ANY != current_lib_type &&
|
145
|
+
default_lib_linking_mode != current_lib_type
|
146
|
+
lib_linking_mode_switch( default_lib_linking_mode )
|
147
|
+
else
|
148
|
+
''
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
end # class ClangFamily
|
153
|
+
|
154
|
+
end # module Toolsets
|
155
|
+
|
156
|
+
end # module Cpp
|
157
|
+
|
158
|
+
end # module MxxRu
|
159
|
+
|
@@ -0,0 +1,55 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 1996-2004, Yauheni Akhotnikau
|
3
|
+
# Copyright (c) 2004-2006, JSC Intervale
|
4
|
+
# Copyright (c) 2006-2011, 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/toolsets/clang_family'
|
30
|
+
|
31
|
+
module MxxRu
|
32
|
+
module Cpp
|
33
|
+
module Toolsets
|
34
|
+
|
35
|
+
# Toolset implemetation for Clang compiler.
|
36
|
+
class ClangLinux < ClangFamily
|
37
|
+
public
|
38
|
+
|
39
|
+
def initialize( a_name = "clang" )
|
40
|
+
super( a_name )
|
41
|
+
setup_tag( "host_os", "unix" )
|
42
|
+
setup_tag( "target_os", "unix" )
|
43
|
+
setup_tag( "unix_port", "linux" )
|
44
|
+
end
|
45
|
+
|
46
|
+
end # class ClangFamily
|
47
|
+
|
48
|
+
end # module Toolsets
|
49
|
+
|
50
|
+
end # module Cpp
|
51
|
+
|
52
|
+
end # module MxxRu
|
53
|
+
|
54
|
+
MxxRu::Cpp::setup_toolset( MxxRu::Cpp::Toolsets::ClangLinux.new )
|
55
|
+
|
@@ -43,6 +43,14 @@ class GccUnixFamily < GccFamily
|
|
43
43
|
super( name )
|
44
44
|
end
|
45
45
|
|
46
|
+
# This implementation adds -fPIC option for GccUnix compilers.
|
47
|
+
# In 1.5.6 version -fPIC existed in GccFamily toolset's method but
|
48
|
+
# MinGW doesn't support that option.
|
49
|
+
def setup_mandatory_options( target )
|
50
|
+
super( target )
|
51
|
+
target.compiler_option( "-fPIC" )
|
52
|
+
end
|
53
|
+
|
46
54
|
# Special implementation for support explicit library type linker option.
|
47
55
|
def make_linker_include_lib_options( target, libs )
|
48
56
|
current_lib_type = nil
|
@@ -0,0 +1,58 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 1996-2004, Yauheni Akhotnikau
|
3
|
+
# Copyright (c) 2004-2006, JSC Intervale
|
4
|
+
# Copyright (c) 2006-2011, 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 'ostruct'
|
30
|
+
require 'set'
|
31
|
+
|
32
|
+
require 'mxx_ru/cpp/target'
|
33
|
+
require 'mxx_ru/cpp/toolsets/vc8_family'
|
34
|
+
|
35
|
+
module MxxRu
|
36
|
+
module Cpp
|
37
|
+
module Toolsets
|
38
|
+
|
39
|
+
# Toolset implementation for Visual C++ 11.0 (Visual Studio 2012)
|
40
|
+
#
|
41
|
+
# Setups following tags:
|
42
|
+
# [_ver_hi_] high version number. Value: 11.
|
43
|
+
# [_ver_lo_] low version number. Value: 0.
|
44
|
+
class Vc11 < MxxRu::Cpp::Toolsets::Vc8Family
|
45
|
+
def initialize( a_name = "vc" )
|
46
|
+
super( a_name )
|
47
|
+
|
48
|
+
setup_tag( "ver_hi", "11" )
|
49
|
+
setup_tag( "ver_lo", "0" )
|
50
|
+
end
|
51
|
+
end # class Vc11
|
52
|
+
|
53
|
+
end # module Toolsets
|
54
|
+
end # module Cpp
|
55
|
+
end # module MxxRu
|
56
|
+
|
57
|
+
MxxRu::Cpp::setup_toolset( MxxRu::Cpp::Toolsets::Vc11.new )
|
58
|
+
|
data/lib/mxx_ru/util.rb
CHANGED
@@ -361,7 +361,7 @@ module MxxRu
|
|
361
361
|
# Get OS name where script is exeuted.
|
362
362
|
def Util.host_os
|
363
363
|
if !@@host_os
|
364
|
-
@@host_os =
|
364
|
+
@@host_os = RbConfig::CONFIG[ "host_os" ]
|
365
365
|
end
|
366
366
|
|
367
367
|
return @@host_os
|
@@ -371,7 +371,7 @@ module MxxRu
|
|
371
371
|
#
|
372
372
|
# Since v.1.5.1
|
373
373
|
#
|
374
|
-
IS_WINDOWS_PLATFORM = !((
|
374
|
+
IS_WINDOWS_PLATFORM = !((RbConfig::CONFIG['host_os'] =~ /mswin|mingw/).nil?)
|
375
375
|
|
376
376
|
# Transform separators in file names to correct ones on the given platform.
|
377
377
|
#
|
data/lib/mxx_ru/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Mxx_ru
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-05-20 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email: eao197@yahoo.com
|
@@ -259,6 +259,8 @@ files:
|
|
259
259
|
- lib/mxx_ru/cpp/toolsets/c89_etk_nsk.rb
|
260
260
|
- lib/mxx_ru/cpp/toolsets/c89_nsk.rb
|
261
261
|
- lib/mxx_ru/cpp/toolsets/c89_nsk_family.rb
|
262
|
+
- lib/mxx_ru/cpp/toolsets/clang_family.rb
|
263
|
+
- lib/mxx_ru/cpp/toolsets/clang_linux.rb
|
262
264
|
- lib/mxx_ru/cpp/toolsets/gcc_cygwin.rb
|
263
265
|
- lib/mxx_ru/cpp/toolsets/gcc_darwin.rb
|
264
266
|
- lib/mxx_ru/cpp/toolsets/gcc_family.rb
|
@@ -268,6 +270,7 @@ files:
|
|
268
270
|
- lib/mxx_ru/cpp/toolsets/gcc_unix_family.rb
|
269
271
|
- lib/mxx_ru/cpp/toolsets/icc_win.rb
|
270
272
|
- lib/mxx_ru/cpp/toolsets/vc10.rb
|
273
|
+
- lib/mxx_ru/cpp/toolsets/vc11.rb
|
271
274
|
- lib/mxx_ru/cpp/toolsets/vc7.rb
|
272
275
|
- lib/mxx_ru/cpp/toolsets/vc8.rb
|
273
276
|
- lib/mxx_ru/cpp/toolsets/vc8_family.rb
|
@@ -314,6 +317,24 @@ files:
|
|
314
317
|
- examples/exe_dll_lib_2/say/prj.rb
|
315
318
|
- examples/exe_dll_lib_2/say/say.cpp
|
316
319
|
- examples/exe_dll_lib_2/say/say.hpp
|
320
|
+
- examples/exe_dll_lib_3/build.rb
|
321
|
+
- examples/exe_dll_lib_3/inout/inout.cpp
|
322
|
+
- examples/exe_dll_lib_3/inout/inout.hpp
|
323
|
+
- examples/exe_dll_lib_3/inout/prj.rb
|
324
|
+
- examples/exe_dll_lib_3/log/log.cpp
|
325
|
+
- examples/exe_dll_lib_3/log/log.hpp
|
326
|
+
- examples/exe_dll_lib_3/log/prj.rb
|
327
|
+
- examples/exe_dll_lib_3/logic/logic.cpp
|
328
|
+
- examples/exe_dll_lib_3/logic/logic.hpp
|
329
|
+
- examples/exe_dll_lib_3/logic/prj.rb
|
330
|
+
- examples/exe_dll_lib_3/main/main.cpp
|
331
|
+
- examples/exe_dll_lib_3/main/prj.rb
|
332
|
+
- examples/exe_dll_lib_3/math/math.cpp
|
333
|
+
- examples/exe_dll_lib_3/math/math.hpp
|
334
|
+
- examples/exe_dll_lib_3/math/prj.rb
|
335
|
+
- examples/exe_dll_lib_3/say/prj.rb
|
336
|
+
- examples/exe_dll_lib_3/say/say.cpp
|
337
|
+
- examples/exe_dll_lib_3/say/say.hpp
|
317
338
|
- examples/simple_exe/main.cpp
|
318
339
|
- examples/simple_exe/prj.rb
|
319
340
|
- THANKS
|
@@ -344,7 +365,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
344
365
|
version: '0'
|
345
366
|
requirements: []
|
346
367
|
rubyforge_project:
|
347
|
-
rubygems_version: 1.8.
|
368
|
+
rubygems_version: 1.8.23
|
348
369
|
signing_key:
|
349
370
|
specification_version: 3
|
350
371
|
summary: Mxx_ru (Make++ on Ruby) is a cross-platform build tool
|