atomic-arch-config.jam
3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#
# Copyright Andrey Semashev 2020.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# This jamfile contains utility rules to select architecture-specific compiler flags
import common ;
import feature ;
import configure ;
rule deduce-architecture ( properties * )
{
local architecture = [ feature.get-values "architecture" : $(properties) ] ;
if $(architecture)
{
return $(architecture) ;
}
else
{
if [ configure.builds /boost/architecture//x86 : $(properties) : "x86" ]
{
return x86 ;
}
else if [ configure.builds /boost/architecture//arm : $(properties) : "arm" ]
{
return arm ;
}
else if [ configure.builds /boost/architecture//mips1 : $(properties) : "mips1" ]
{
return mips1 ;
}
else if [ configure.builds /boost/architecture//power : $(properties) : "power" ]
{
return power ;
}
else if [ configure.builds /boost/architecture//sparc : $(properties) : "sparc" ]
{
return sparc ;
}
}
}
rule deduce-address-model ( properties * )
{
local address_model = [ feature.get-values "address-model" : $(properties) ] ;
if $(address_model)
{
return $(address_model) ;
}
else
{
if [ configure.builds /boost/architecture//32 : $(properties) : "32-bit" ]
{
return 32 ;
}
else if [ configure.builds /boost/architecture//64 : $(properties) : "64-bit" ]
{
return 64 ;
}
}
}
rule sse2-flags ( properties * )
{
local result ;
if <toolset>intel in $(properties)
{
if <toolset-intel:platform>win in $(properties)
{
result = <cxxflags>"/QxSSE2" ;
}
else
{
result = <cxxflags>"-xSSE2" ;
}
}
else if <toolset>msvc in $(properties)
{
# MSVC doesn't really care about these switches, all SSE intrinsics are always available, but still...
# Also 64 bit MSVC doesn't have the /arch:SSE2 switch as it is the default.
if 32 in [ deduce-address-model $(properties) ]
{
result = <cxxflags>"/arch:SSE2" ;
}
}
else
{
result = <cxxflags>"-msse -msse2" ;
}
return $(result) ;
}
rule sse41-flags ( properties * )
{
local result ;
if <toolset>intel in $(properties)
{
if <toolset-intel:platform>win in $(properties)
{
result = <cxxflags>"/QxSSE4.1" ;
}
else
{
result = <cxxflags>"-xSSE4.1" ;
}
}
else if <toolset>msvc in $(properties)
{
# MSVC doesn't really care about these switches, all SSE intrinsics are always available, but still...
# Also 64 bit MSVC doesn't have the /arch:SSE2 switch as it is the default.
if 32 in [ deduce-address-model $(properties) ]
{
result = <cxxflags>"/arch:SSE2" ;
}
}
else
{
result = <cxxflags>"-msse -msse2 -msse3 -mssse3 -msse4.1" ;
}
return $(result) ;
}