2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-18 01:52:17 +00:00

Make c-scanner use native path format for included headers in order to match the names of generated headers

[SVN r50390]
This commit is contained in:
Steven Watanabe
2008-12-27 20:31:15 +00:00
parent 7383a8c9c8
commit 825b906ec0
2 changed files with 37 additions and 0 deletions

View File

@@ -45,4 +45,37 @@ t.run_build_system()
t.expect_addition("bin/$toolset/debug/hello.exe")
t.rm("bin")
t.write("jamroot.jam", """
make dir/a.h : : gen-header ;
explicit dir/a.h ;
exe hello : hello.cpp : <implicit-dependency>dir/a.h ;
import os ;
if [ os.name ] = NT
{
actions gen-header
{
echo int i; > $(<)
}
}
else
{
actions gen-header
{
echo "int i;" > $(<)
}
}
""")
t.write("hello.cpp", """
#include "dir/a.h"
int main() { return i; }
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/hello.exe")
t.cleanup()

View File

@@ -15,11 +15,13 @@ import feature ;
import generators ;
import numbers ;
import os ;
import path ;
import print ;
import project ;
import property ;
import regex ;
import scanner ;
import sequence ;
import stage ;
import symlink ;
import toolset ;
@@ -441,7 +443,9 @@ class c-scanner : scanner
rule process ( target : matches * : binding )
{
local angle = [ regex.transform $(matches) : "<(.*)>" ] ;
angle = [ sequence.transform path.native : $(angle) ] ;
local quoted = [ regex.transform $(matches) : "\"(.*)\"" ] ;
quoted = [ sequence.transform path.native : $(quoted) ] ;
# CONSIDER: the new scoping rule seem to defeat "on target" variables.
local g = [ on $(target) return $(HDRGRIST) ] ;