summaryrefslogtreecommitdiff
path: root/boostcpp.jam
diff options
context:
space:
mode:
authorPeter Dimov <pdimov@gmail.com>2020-09-05 18:05:02 +0300
committerPeter Dimov <pdimov@gmail.com>2021-06-12 00:03:53 +0300
commit976deac5cbcf5b37dec093175831880fe0e7ec51 (patch)
tree833ba84f55fc5634fb79347d85440176393fe0a9 /boostcpp.jam
parentb7ca8b7dcc077d2e0c1eeea6b5a7438ddc3ee839 (diff)
downloadboost-976deac5cbcf5b37dec093175831880fe0e7ec51.tar.gz
Add an option --allow-shared-static that enables link=shared, runtime-link=static; refactor and reword warning message
Diffstat (limited to 'boostcpp.jam')
-rw-r--r--boostcpp.jam27
1 files changed, 27 insertions, 0 deletions
diff --git a/boostcpp.jam b/boostcpp.jam
index 299401778d..082536e2a5 100644
--- a/boostcpp.jam
+++ b/boostcpp.jam
@@ -278,9 +278,24 @@ rule declare_install_and_stage_proper_targets ( libraries * )
#
################################################################################
+rule emit-shared-static-warning ( )
+{
+ if ! $(.shared-static-warning-emitted)
+ {
+ ECHO "" ;
+ ECHO "warning: The configuration link=shared, runtime-link=static is disabled" ;
+ ECHO "warning: by default as being too dangerous to use, and will not be built." ;
+ ECHO "warning: To enable it, use --allow-shared-static." ;
+ ECHO "" ;
+
+ .shared-static-warning-emitted = 1 ;
+ }
+}
+
class top-level-target : alias-target-class
{
import modules ;
+ import boostcpp ;
rule __init__ ( name : project : sources * : requirements *
: default-build * : usage-requirements * )
@@ -374,15 +389,22 @@ class top-level-target : alias-target-class
: $(build-type-set) ] ;
# Filter inappopriate combinations.
+
local filtered ;
+ local skipped ;
+
+ local argv = [ modules.peek : ARGV ] ;
+
for local p in $(expanded)
{
# See comment in handle-static-runtime regarding this logic.
if [ $(p).get <link> ] = shared
&& [ $(p).get <runtime-link> ] = static
&& [ $(p).get <toolset> ] != cw
+ && ! --allow-shared-static in $(argv)
{
# Skip this.
+ skipped += $(p) ;
}
else
{
@@ -390,6 +412,11 @@ class top-level-target : alias-target-class
}
}
+ if $(expanded) = $(skipped)
+ {
+ boostcpp.emit-shared-static-warning ;
+ }
+
return [ build-multiple $(filtered) ] ;
}
}