diff --git a/tools/build/v2/tools/clang-darwin.jam b/tools/build/v2/tools/clang-darwin.jam index a8abc7d..e43d933 100644 --- a/tools/build/v2/tools/clang-darwin.jam +++ b/tools/build/v2/tools/clang-darwin.jam @@ -13,6 +13,7 @@ import gcc ; import common ; import errors ; import generators ; +import darwin ; feature.extend-subfeature toolset clang : platform : darwin ; @@ -74,6 +75,7 @@ SPACE = " " ; flags clang-darwin.compile OPTIONS ; flags clang-darwin.compile OPTIONS ; +flags clang-darwin.compile FRAMEWORK ; # flags clang-darwin.compile INCLUDES ; # Declare flags and action for compilation. @@ -94,14 +96,24 @@ toolset.flags clang-darwin.compile OPTIONS on : -g ; toolset.flags clang-darwin.compile OPTIONS on : -pg ; toolset.flags clang-darwin.compile OPTIONS off : -fno-rtti ; +rule compile.c ( targets * : sources * : properties * ) +{ + darwin.prepare-framework-path $(<) ; +} + actions compile.c { - "$(CONFIG_COMMAND)" -x c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" -x c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" $(FRAMEWORK_PATH) -c -o "$(<)" "$(>)" +} + +rule compile.c++ ( targets * : sources * : properties * ) +{ + darwin.prepare-framework-path $(<) ; } actions compile.c++ { - "$(CONFIG_COMMAND)" -x c++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" -x c++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" $(FRAMEWORK_PATH) -c -o "$(<)" "$(>)" } flags clang-darwin ARFLAGS ; @@ -149,6 +161,7 @@ actions piecemeal archive } flags clang-darwin.link USER_OPTIONS ; +flags clang-darwin.link FRAMEWORK ; # Declare actions for linking rule link ( targets * : sources * : properties * ) @@ -157,14 +170,15 @@ rule link ( targets * : sources * : properties * ) # Serialize execution of the 'link' action, since # running N links in parallel is just slower. JAM_SEMAPHORE on $(targets) = clang-darwin-link-semaphore ; + darwin.prepare-framework-path $(<) ; } actions link bind LIBRARIES { - "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) + "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(FRAMEWORK_PATH) -framework$(SPACE)$(FRAMEWORK:D=:S=) $(OPTIONS) } actions link.dll bind LIBRARIES { - "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" -single_module -dynamiclib -install_name "$(<[1]:D=)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) + "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" -single_module -dynamiclib -install_name "$(<[1]:D=)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(FRAMEWORK_PATH) -framework$(SPACE)$(FRAMEWORK:D=:S=) $(OPTIONS) } diff --git a/tools/build/v2/tools/darwin.jam b/tools/build/v2/tools/darwin.jam index dd6eacb..4955576 100644 --- a/tools/build/v2/tools/darwin.jam +++ b/tools/build/v2/tools/darwin.jam @@ -529,7 +529,7 @@ flags darwin.link FORCE_LOAD ; _ = " " ; # set up the -F option to include the paths to any frameworks used. -local rule prepare-framework-path ( target + ) +rule prepare-framework-path ( target + ) { # The -framework option only takes basename of the framework. # The -F option specifies the directories where a framework