summaryrefslogtreecommitdiff
path: root/tools/build/src/tools/clang-linux.jam
diff options
context:
space:
mode:
Diffstat (limited to 'tools/build/src/tools/clang-linux.jam')
-rw-r--r--tools/build/src/tools/clang-linux.jam29
1 files changed, 23 insertions, 6 deletions
diff --git a/tools/build/src/tools/clang-linux.jam b/tools/build/src/tools/clang-linux.jam
index 668078e09..0aa29d519 100644
--- a/tools/build/src/tools/clang-linux.jam
+++ b/tools/build/src/tools/clang-linux.jam
@@ -91,7 +91,7 @@ toolset.flags clang-linux.compile OPTIONS <rtti>off : -fno-rtti ;
# C and C++ compilation
rule compile.c++ ( targets * : sources * : properties * ) {
- gcc.setup-threading $(targets) : $(sources) : $(properties) ;
+ setup-threading $(targets) : $(sources) : $(properties) ;
gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
@@ -117,7 +117,7 @@ actions compile.c++.with-pch bind PCH_FILE
rule compile.c ( targets * : sources * : properties * )
{
- gcc.setup-threading $(targets) : $(sources) : $(properties) ;
+ setup-threading $(targets) : $(sources) : $(properties) ;
gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
@@ -146,7 +146,7 @@ actions compile.c.with-pch bind PCH_FILE
# PCH emission
rule compile.c++.pch ( targets * : sources * : properties * ) {
- gcc.setup-threading $(targets) : $(sources) : $(properties) ;
+ setup-threading $(targets) : $(sources) : $(properties) ;
gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
}
@@ -156,7 +156,7 @@ actions compile.c++.pch {
}
rule compile.c.pch ( targets * : sources * : properties * ) {
- gcc.setup-threading $(targets) : $(sources) : $(properties) ;
+ setup-threading $(targets) : $(sources) : $(properties) ;
gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
}
@@ -172,7 +172,7 @@ actions compile.c.pch
SPACE = " " ;
rule link ( targets * : sources * : properties * ) {
- gcc.setup-threading $(targets) : $(sources) : $(properties) ;
+ setup-threading $(targets) : $(sources) : $(properties) ;
gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
SPACE on $(targets) = " " ;
JAM_SEMAPHORE on $(targets) = <s>clang-linux-link-semaphore ;
@@ -183,12 +183,29 @@ actions link bind LIBRARIES {
}
rule link.dll ( targets * : sources * : properties * ) {
- gcc.setup-threading $(targets) : $(sources) : $(properties) ;
+ setup-threading $(targets) : $(sources) : $(properties) ;
gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
SPACE on $(targets) = " " ;
JAM_SEMAPHORE on $(targets) = <s>clang-linux-link-semaphore ;
}
+rule setup-threading ( targets * : sources * : properties * )
+{
+
+ local target = [ feature.get-values target-os : $(properties) ] ;
+
+ switch $(target)
+ {
+ case windows :
+ local threading = [ feature.get-values threading : $(properties) ] ;
+ if $(threading) = multi
+ {
+ OPTIONS on $(targets) += -pthread ;
+ }
+ case * : gcc.setup-threading $(targets) : $(sources) : $(properties) ;
+ }
+}
+
# Differ from 'link' above only by -shared.
actions link.dll bind LIBRARIES {
"$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS)