Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/tools/clang-darwin.jam
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ rule init ( version ? : command * : options * )
: version $(version) ] ;

common.handle-options clang-darwin : $(condition) : $(command) : $(options) ;
clang.init-flags clang-darwin : $(condition) : $(version) ;
clang.init-flags clang-darwin : $(condition) : $(version) :
[ feature.get-values <triplet> : $(options) ] ;

# - Archive builder.
local archiver = [ feature.get-values <archiver> : $(options) ] ;
Expand Down
11 changes: 9 additions & 2 deletions src/tools/clang-linux.jam
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
= Clang (GCC frontend)

The `clang-linux` module supports Clang with GCC frontend and has the same
options as link:#b2.reference.tools.compiler.gcc[`gcc`] toolset.
options as link:#b2.reference.tools.compiler.gcc[`gcc`] toolset, with the
addition of `<triple>` option.

The value of that option is passed as the value of `--target=` flag, unless
provided as `<triple>none`. In that case the flag is not passed to the build
tools. If the option is not provided the build system may try to guess the
correct target triple.

|# # end::doc[]

Expand Down Expand Up @@ -68,7 +74,8 @@ rule init ( version ? : command * : options * ) {
: version $(version) ] ;

common.handle-options clang-linux : $(condition) : $(command) : $(options) ;
clang.init-flags clang-linux : $(condition) : $(version) ;
clang.init-flags clang-linux : $(condition) : $(version) :
[ feature.get-values <triple> : $(options) ] ;

# Support for gcc root as the backend, this is mainly useful for clang/gcc on Windows
# since on Linux gcc will be the default compiler already located on the PATH.
Expand Down
30 changes: 23 additions & 7 deletions src/tools/clang.jam
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,36 @@ local rule init-flags-cross ( toolset : condition * : architecture + : address-m
case x86-32 : arch = i386 ;
}

toolset.flags $(toolset)
OPTIONS $(condition)/<target-os>$(target-os)/<architecture>$(_architecture_)/<address-model>$(_address-model_)
: "--target=$(arch)-$(vendor-sys)"
: unchecked ;
set-triple $(toolset) :
$(condition)/<target-os>$(target-os)/<architecture>$(_architecture_)/<address-model>$(_address-model_)
: "$(arch)-$(vendor-sys)"
;
}
}
}

rule init-flags ( toolset : condition * : version )
local rule set-triple ( toolset : condition : triple )
{
toolset.flags $(toolset) OPTIONS $(condition) : --target=$(triple)
: unchecked ;
}

rule init-flags ( toolset : condition * : version : triple ? )
{
init-cxxstd-flags $(toolset) : $(condition) : $(version) ;

init-flags-cross $(toolset) : $(condition) : arm x86 : 64 : darwin ;
init-flags-cross $(toolset) : $(condition) : arm x86 : 64 32 : linux ;
if ! $(triple)
{
init-flags-cross $(toolset) : $(condition) : arm x86 : 64 : darwin ;
init-flags-cross $(toolset) : $(condition) : arm x86 : 64 32 : linux ;
}
else
{
if $(triple) != none
{
set-triple $(toolset) : $(condition) : $(triple) ;
}
}

# This is a temporary solution for doing combined architecture builds on macOS.
toolset.flags $(toolset)
Expand Down
Loading