File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,7 +50,8 @@ rule init ( version ? : command * : options * )
5050 : version $(version) ] ;
5151
5252 common.handle-options clang-darwin : $(condition) : $(command) : $(options) ;
53- clang.init-flags clang-darwin : $(condition) : $(version) ;
53+ clang.init-flags clang-darwin : $(condition) : $(version) :
54+ [ feature.get-values <triplet> : $(options) ] ;
5455
5556 # - Archive builder.
5657 local archiver = [ feature.get-values <archiver> : $(options) ] ;
Original file line number Diff line number Diff line change 1313= Clang (GCC frontend)
1414
1515The `clang-linux` module supports Clang with GCC frontend and has the same
16- options as link:#b2.reference.tools.compiler.gcc[`gcc`] toolset.
16+ options as link:#b2.reference.tools.compiler.gcc[`gcc`] toolset, with the
17+ addition of `<triple>` option.
18+
19+ The value of that option is passed as the value of `--target=` flag, unless
20+ provided as `<triple>none`. In that case the flag is not passed to the build
21+ tools. If the option is not provided the build system may try to guess the
22+ correct target triple.
1723
1824|# # end::doc[]
1925
@@ -68,7 +74,8 @@ rule init ( version ? : command * : options * ) {
6874 : version $(version) ] ;
6975
7076 common.handle-options clang-linux : $(condition) : $(command) : $(options) ;
71- clang.init-flags clang-linux : $(condition) : $(version) ;
77+ clang.init-flags clang-linux : $(condition) : $(version) :
78+ [ feature.get-values <triple> : $(options) ] ;
7279
7380 # Support for gcc root as the backend, this is mainly useful for clang/gcc on Windows
7481 # since on Linux gcc will be the default compiler already located on the PATH.
Original file line number Diff line number Diff line change @@ -92,20 +92,36 @@ local rule init-flags-cross ( toolset : condition * : architecture + : address-m
9292 case x86-32 : arch = i386 ;
9393 }
9494
95- toolset.flags $(toolset)
96- OPTIONS $(condition)/<target-os>$(target-os)/<architecture>$(_architecture_)/<address-model>$(_address-model_)
97- : "--target= $(arch)-$(vendor-sys)"
98- : unchecked ;
95+ set-triple $(toolset) :
96+ $(condition)/<target-os>$(target-os)/<architecture>$(_architecture_)/<address-model>$(_address-model_)
97+ : "$(arch)-$(vendor-sys)"
98+ ;
9999 }
100100 }
101101}
102102
103- rule init-flags ( toolset : condition * : version )
103+ local rule set-triple ( toolset : condition : triple )
104+ {
105+ toolset.flags $(toolset) OPTIONS $(condition) : --target=$(triple)
106+ : unchecked ;
107+ }
108+
109+ rule init-flags ( toolset : condition * : version : triple ? )
104110{
105111 init-cxxstd-flags $(toolset) : $(condition) : $(version) ;
106112
107- init-flags-cross $(toolset) : $(condition) : arm x86 : 64 : darwin ;
108- init-flags-cross $(toolset) : $(condition) : arm x86 : 64 32 : linux ;
113+ if ! $(triple)
114+ {
115+ init-flags-cross $(toolset) : $(condition) : arm x86 : 64 : darwin ;
116+ init-flags-cross $(toolset) : $(condition) : arm x86 : 64 32 : linux ;
117+ }
118+ else
119+ {
120+ if $(triple) != none
121+ {
122+ set-triple $(toolset) : $(condition) : $(triple) ;
123+ }
124+ }
109125
110126 # This is a temporary solution for doing combined architecture builds on macOS.
111127 toolset.flags $(toolset)
You can’t perform that action at this time.
0 commit comments