stevedonovan / Lake

A Lua-based Build Tool
MIT License
132 stars 16 forks source link

error while include *.c file #5

Closed moteus closed 11 years ago

moteus commented 12 years ago

in my file i have : #include "some.c" command line is: cl ... /showIncludes ... produce output : Note: including file: ....\some.c in filter we match this line as file target

function c.filter(line,action) .... elseif line:match(file_pat) then .. end

stevedonovan commented 12 years ago

You will have to give me more background - maybe give me a lakefile and a very simple job that illustrates the problem.

The only problem with using c.filter with CL is that it overrides the usual meaning, which is to collect the dependencies and generate a .d file.

stevedonovan commented 12 years ago

Right, I can reproduce the problem - should be fixed by tomorrow!

stevedonovan commented 12 years ago

Right, the file_pat was falsely matching on the ..\file.c...

My fix is to define file_pat to try match a plain file name followed by '.c' (or .cpp, etc)

file_pat = '^[^:]-%'..rule.in_ext..'$'

That is, ^[^:] instead of ., which matches anything upto .c

steve d.