Jamfile.v2
3.62 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# Boost.Atomic Library Jamfile
#
# Copyright Helge Bahmann 2011.
# Copyright Andrey Semashev 2018, 2020-2021.
#
# 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)
import common ;
import path ;
import project ;
import feature ;
import configure ;
import atomic-arch-config ;
local here = [ modules.binding $(__name__) ] ;
project.push-current [ project.current ] ;
project.load [ path.join [ path.make $(here:D) ] ../../config/checks/architecture ] ;
project.pop-current ;
lib synchronization ;
explicit synchronization ;
rule check-synchronization-lib ( properties * )
{
local result ;
if <target-os>windows in $(properties)
{
if [ configure.builds ../config//has_synchronization_lib : $(properties) : "has synchronization.lib" ]
{
result += <library>synchronization ;
}
else
{
result += <define>BOOST_ATOMIC_NO_SYNCHRONIZATION_LIB ;
}
}
return $(result) ;
}
project boost/atomic
: requirements
<include>../src
<threading>multi
<link>shared:<define>BOOST_ATOMIC_DYN_LINK=1
<link>static:<define>BOOST_ATOMIC_STATIC_LINK=1
<define>BOOST_ATOMIC_SOURCE
<target-os>windows:<define>BOOST_USE_WINDOWS_H
<toolset>gcc,<target-os>windows:<linkflags>"-lkernel32"
: usage-requirements
<link>shared:<define>BOOST_ATOMIC_DYN_LINK=1
<link>static:<define>BOOST_ATOMIC_STATIC_LINK=1
: source-location ../src
;
BOOST_ATOMIC_SOURCES_SSE2 =
find_address_sse2
;
BOOST_ATOMIC_SOURCES_SSE41 =
find_address_sse41
;
for local src in $(BOOST_ATOMIC_SOURCES_SSE2)
{
obj $(src)
: ## sources ##
$(src).cpp
: ## requirements ##
<conditional>@atomic-arch-config.sse2-flags
<link>shared:<define>BOOST_ATOMIC_DYN_LINK=1
<link>static:<define>BOOST_ATOMIC_STATIC_LINK=1
<define>BOOST_ATOMIC_SOURCE
;
explicit $(src) ;
}
for local src in $(BOOST_ATOMIC_SOURCES_SSE41)
{
obj $(src)
: ## sources ##
$(src).cpp
: ## requirements ##
<conditional>@atomic-arch-config.sse41-flags
<link>shared:<define>BOOST_ATOMIC_DYN_LINK=1
<link>static:<define>BOOST_ATOMIC_STATIC_LINK=1
<define>BOOST_ATOMIC_SOURCE
;
explicit $(src) ;
}
rule select-arch-specific-sources ( properties * )
{
local result ;
if x86 in [ atomic-arch-config.deduce-architecture $(properties) ]
{
if [ configure.builds ../config//has_sse2 : $(properties) : "compiler supports SSE2" ]
{
result += <source>$(BOOST_ATOMIC_SOURCES_SSE2) ;
result += <define>BOOST_ATOMIC_USE_SSE2 ;
}
if [ configure.builds ../config//has_sse41 : $(properties) : "compiler supports SSE4.1" ]
{
result += <source>$(BOOST_ATOMIC_SOURCES_SSE41) ;
result += <define>BOOST_ATOMIC_USE_SSE41 ;
}
}
# ECHO "Arch sources: " $(result) ;
return $(result) ;
}
rule select-platform-specific-sources ( properties * )
{
local result ;
if <target-os>windows in $(properties)
{
result += <source>wait_on_address.cpp ;
}
# ECHO Platform sources: $(result) ;
return $(result) ;
}
lib boost_atomic
: ## sources ##
lock_pool.cpp
: ## requirements ##
<include>../src
<conditional>@select-arch-specific-sources
<conditional>@select-platform-specific-sources
: usage-requirements
<conditional>@check-synchronization-lib
;
boost-install boost_atomic ;