feature.extend-subfeature toolset clang : platform : darwin ;
-toolset.inherit-generators clang-darwin
- <toolset>clang <toolset-clang:platform>darwin
- : gcc
+toolset.inherit-generators clang-darwin
+ <toolset>clang <toolset-clang:platform>darwin
+ : gcc
# Don't inherit PCH generators. They were not tested, and probably
# don't work for this compiler.
: gcc.mingw.link gcc.mingw.link.dll gcc.compile.c.pch gcc.compile.c++.pch
generators.register-c-compiler clang-darwin.compile.mm : OBJECTIVE_CPP : OBJ : <toolset>clang <toolset-clang:platform>darwin ;
toolset.inherit-rules clang-darwin : gcc ;
-toolset.inherit-flags clang-darwin : gcc
+toolset.inherit-flags clang-darwin : gcc
: <inlining>full
<architecture>x86/<address-model>32
<architecture>x86/<address-model>64
+ <lto>on/<lto-mode>full
+ <lto>on/<lto-mode>fat
;
-
+
if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
{
.debug-configuration = true ;
}
-
+
# Initializes the clang-darwin toolset
# version in optional
# name (default clang++) is used to invoke the specified clang compiler
# compile and link options allow you to specify addition command line options for each version
rule init ( version ? : command * : options * )
{
- command = [ common.get-invocation-command clang-darwin : clang++
+ command = [ common.get-invocation-command clang-darwin : clang++
: $(command) : /usr/bin /usr/local/bin ] ;
# Determine the version
local command-string = $(command:J=" ") ;
if $(command)
- {
+ {
version ?= [ MATCH "version ([0-9]+[.][0-9]+)"
: [ SHELL "$(command-string) --version" ] ] ;
}
# shouldn't this be handled by the common gcc?
toolset.flags clang-darwin.compile OPTIONS <flags> ;
+# LTO
+toolset.flags clang-darwin.compile OPTIONS <lto>on/<lto-mode>thin : -flto=thin ;
+toolset.flags clang-darwin.link OPTIONS <lto>on/<lto-mode>thin : -flto=thin ;
+
+toolset.flags clang-darwin.compile OPTIONS <lto>on/<lto-mode>full : -flto=full ;
+toolset.flags clang-darwin.link OPTIONS <lto>on/<lto-mode>full : -flto=full ;
+
+# stdlib selection
+toolset.flags clang-darwin.compile OPTIONS <stdlib>gnu <stdlib>gnu11 : -stdlib=libstdc++ ;
+toolset.flags clang-darwin.link OPTIONS <stdlib>gnu <stdlib>gnu11 : -stdlib=libstdc++ ;
+
+toolset.flags clang-darwin.compile OPTIONS <stdlib>libc++ : -stdlib=libc++ ;
+toolset.flags clang-darwin.link OPTIONS <stdlib>libc++ : -stdlib=libc++ ;
+
actions compile.c
{
"$(CONFIG_COMMAND)" -x c $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
# Always remove archive and start again. Here's rationale from
# Andre Hentz:
#
- # I had a file, say a1.c, that was included into liba.a.
- # I moved a1.c to a2.c, updated my Jamfiles and rebuilt.
- # My program was crashing with absurd errors.
- # After some debugging I traced it back to the fact that a1.o was *still*
- # in liba.a
+ # I had a file, say a1.c, that was included into liba.a.
+ # I moved a1.c to a2.c, updated my Jamfiles and rebuilt.
+ # My program was crashing with absurd errors.
+ # After some debugging I traced it back to the fact that a1.o was *still*
+ # in liba.a
#
# Rene Rivera:
#