From 57d49df2ca4ef667a1269804f14d90d8c0b6eea5 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Wed, 19 Feb 2003 10:23:03 +0000 Subject: [PATCH] Allow the use of an unconfigured msvc as long as the PATH, etc., are set up. [SVN r17524] --- new/msvc.jam | 13 ++++++++----- new/toolset.jam | 9 ++++++++- v2/build/toolset.jam | 9 ++++++++- v2/msvc.jam | 13 ++++++++----- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/new/msvc.jam b/new/msvc.jam index 8f6aea63d..7ef3ec851 100755 --- a/new/msvc.jam +++ b/new/msvc.jam @@ -84,10 +84,13 @@ rule init ( version ? path ? : vendor ? : setup ? compiler ? linker ? ) compiler ?= cl ; linker ?= link ; - flags msvc.compile CC $(condition) : $(prefix)$(compiler) ; - flags msvc.link LD $(condition) : $(prefix)$(linker) ; + flags msvc.compile .CC $(condition) : $(prefix)$(compiler) ; + flags msvc.link .LD $(condition) : $(prefix)$(linker) ; } +.CC = cl ; +.LD = link ; + # Declare generators # is it possible to combine these? @@ -131,7 +134,7 @@ flags msvc.compile INCLUDES ; actions compile { - $(CC) /Zm800 -nologo -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(USER_CFLAGS) -I"$(INCLUDES)" -c -Fo"$(<)" "$(>)" + $(.CC) /Zm800 -nologo -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(USER_CFLAGS) -I"$(INCLUDES)" -c -Fo"$(<)" "$(>)" } # Declare flags and action for linking @@ -157,12 +160,12 @@ toolset.flags msvc.link FINDLIBS ; actions link { - $(LD) /nologo $(NOINCREMENTAL) $(LINKFLAGS) /out:"$(<[1])" /IMPLIB:"$(<[2])" /LIBPATH:"$(LINKPATH)" "$(FINDLIBS:S=.lib)" @"$(>)" + $(.LD) /nologo $(NOINCREMENTAL) $(LINKFLAGS) /out:"$(<[1])" /IMPLIB:"$(<[2])" /LIBPATH:"$(LINKPATH)" "$(FINDLIBS:S=.lib)" @"$(>)" } # Declare action for creating static libraries actions archive { if exist "$(<)" set _$(<:B)_="$(<)" - $(LD) /nologo /lib /out:"$(<)" %_$(<:B)_% @"$(>)" + $(.LD) /nologo /lib /out:"$(<)" %_$(<:B)_% @"$(>)" } diff --git a/new/toolset.jam b/new/toolset.jam index 529b6b488..13073490e 100644 --- a/new/toolset.jam +++ b/new/toolset.jam @@ -185,7 +185,14 @@ rule set-target-variables ( rule-or-module target : properties * ) } } - $(variable) on $(target) += $(result) ; + # Without this test, the assignment below would create a + # target variable even if $(result) is empty. That is + # undesirable because the empty target variable would mask + # module globals intended to be used as defaults. + if ! $(result)-is-nonempty + { + $(variable) on $(target) += $(result) ; + } } # recurse for any module-specific flags diff --git a/v2/build/toolset.jam b/v2/build/toolset.jam index 529b6b488..13073490e 100644 --- a/v2/build/toolset.jam +++ b/v2/build/toolset.jam @@ -185,7 +185,14 @@ rule set-target-variables ( rule-or-module target : properties * ) } } - $(variable) on $(target) += $(result) ; + # Without this test, the assignment below would create a + # target variable even if $(result) is empty. That is + # undesirable because the empty target variable would mask + # module globals intended to be used as defaults. + if ! $(result)-is-nonempty + { + $(variable) on $(target) += $(result) ; + } } # recurse for any module-specific flags diff --git a/v2/msvc.jam b/v2/msvc.jam index 8f6aea63d..7ef3ec851 100755 --- a/v2/msvc.jam +++ b/v2/msvc.jam @@ -84,10 +84,13 @@ rule init ( version ? path ? : vendor ? : setup ? compiler ? linker ? ) compiler ?= cl ; linker ?= link ; - flags msvc.compile CC $(condition) : $(prefix)$(compiler) ; - flags msvc.link LD $(condition) : $(prefix)$(linker) ; + flags msvc.compile .CC $(condition) : $(prefix)$(compiler) ; + flags msvc.link .LD $(condition) : $(prefix)$(linker) ; } +.CC = cl ; +.LD = link ; + # Declare generators # is it possible to combine these? @@ -131,7 +134,7 @@ flags msvc.compile INCLUDES ; actions compile { - $(CC) /Zm800 -nologo -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(USER_CFLAGS) -I"$(INCLUDES)" -c -Fo"$(<)" "$(>)" + $(.CC) /Zm800 -nologo -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(USER_CFLAGS) -I"$(INCLUDES)" -c -Fo"$(<)" "$(>)" } # Declare flags and action for linking @@ -157,12 +160,12 @@ toolset.flags msvc.link FINDLIBS ; actions link { - $(LD) /nologo $(NOINCREMENTAL) $(LINKFLAGS) /out:"$(<[1])" /IMPLIB:"$(<[2])" /LIBPATH:"$(LINKPATH)" "$(FINDLIBS:S=.lib)" @"$(>)" + $(.LD) /nologo $(NOINCREMENTAL) $(LINKFLAGS) /out:"$(<[1])" /IMPLIB:"$(<[2])" /LIBPATH:"$(LINKPATH)" "$(FINDLIBS:S=.lib)" @"$(>)" } # Declare action for creating static libraries actions archive { if exist "$(<)" set _$(<:B)_="$(<)" - $(LD) /nologo /lib /out:"$(<)" %_$(<:B)_% @"$(>)" + $(.LD) /nologo /lib /out:"$(<)" %_$(<:B)_% @"$(>)" }