Skip to content

Commit

Permalink
The .CC.FILTER can be empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
grafikrobot committed Jun 2, 2024
1 parent 179472f commit 8c8a6de
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions src/tools/msvc.jam
Original file line number Diff line number Diff line change
Expand Up @@ -685,11 +685,18 @@ rule compile.c ( targets + : sources * : properties * )
get-rspline $(targets) : -TC CFLAGS ;
compile-c-c++ $(<) : $(>) ;

local config_command = [ regex.escape [ on $(targets[1]) return $(.CC) ]
: "|()[]\\+.*^$\" " : "\\" ] ;
local cc_filter = [ regex.escape [ on $(targets[1]) return $(.CC.FILTER) ]
: "|()[]\\+.*^$\" " : "\\" ] ;
COMMAND_DATABASE on $(targets) = "($(config_command).*)$(cc_filter)" ;
local cc = [ on $(targets[1]) return $(.CC) ] ;
cc = [ regex.escape "$(cc:J= )" : "|()[]\\+.*^$\" " : "\\" ] ;
local eol = [ on $(targets[1]) return $(.CC.FILTER) ] ;
if $(eol)
{
eol = ".*" [ regex.escape "$(eol:J= )" : "|()[]\\+.*^$\" " : "\\" ] ;
}
else
{
eol = "[^\n]*" "" ;
}
COMMAND_DATABASE on $(targets) = "($(cc)$(eol[1]))$(eol[2])" ;
}


Expand Down Expand Up @@ -759,11 +766,18 @@ rule compile-c-c++ ( targets + : sources * )
local pch-header = [ on $(<[1]) return $(PCH_HEADER) ] ;
PCH_HEADER_AS_SPELLED on $(<[1]) = $(pch-header:G=) ;

local config_command = [ regex.escape [ on $(targets[1]) return $(.CC) ]
: "|()[]\\+.*^$\" " : "\\" ] ;
local cc_filter = [ regex.escape [ on $(targets[1]) return $(.CC.FILTER) ]
: "|()[]\\+.*^$\" " : "\\" ] ;
COMMAND_DATABASE on $(targets) = "($(config_command).*)$(cc_filter)" ;
local cc = [ on $(targets[1]) return $(.CC) ] ;
cc = [ regex.escape "$(cc:J= )" : "|()[]\\+.*^$\" " : "\\" ] ;
local eol = [ on $(targets[1]) return $(.CC.FILTER) ] ;
if $(eol)
{
eol = ".*" [ regex.escape "$(eol:J= )" : "|()[]\\+.*^$\" " : "\\" ] ;
}
else
{
eol = "[^\n]*" "" ;
}
COMMAND_DATABASE on $(targets) = "($(cc)$(eol[1]))$(eol[2])" ;
}

rule preprocess-c-c++ ( targets + : sources * )
Expand Down

0 comments on commit 8c8a6de

Please sign in to comment.