Le 27/05/2014 09:26, Christian Kandeler a écrit :
> On 05/27/2014 12:40 AM, olivier musse wrote:
>> I have implemented Rules for qlalr and flex in qbs but i'm facing an issue.
>> My qlarl rule is well working since the generated cpp file is a file
>> that is compiled.
>> But my flex rule is not working because the generated file is included
>> from another cpp file so is excluded from the files list.
>> When the rules.lex file is modified, ruleslexer.cpp is well generated
>> but the file which includes it (rulesparser.cpp) is not re compiled.
>> How can I do that?
> 1) Do not write the generated file into the source directory, that's
> asking for problems, as indicated by the fact that you needed to add the
> "excludeFiles" property.
This is really not a problem for me to add to the excludeFiles properties.
> 2) If you want your generated file to be considered a C++ source file,
> you need to tell qbs that by giving it the "cpp" file tag:
>       Artifact {
>           fileName:"ruleslexer.cpp"
>       fileTags: "cpp"
>       }
This is what I have done but then the file ruleslexer.cpp is compiled 
and I do not want it to be compile since it is already included in the 
rulesparser.cpp.
What I want is not the ruleslexer.cpp to be compiled after rules.lex 
modification put the file rulesparser.cpp which includes ruleslexer.cpp.
So is there any way to say that rulesparser.cpp need to be recompiled 
(it is not modified) because ruleslexer.cpp has been modified.

BR

Olivier



>
> Christian
>
>
>> BR
>>
>> Olivier
>>
>>
>>
>>
>> ----------------- rulesparser.cpp--------------------------
>> ......
>> #include "ruleslexer.cpp"
>> ......
>>
>> Group{
>>
>>               name:"Source"
>>
>>               files:["*.cpp"]
>>
>>               excludeFiles:['ruleslexer.cpp']
>>
>>           }
>>
>>
>> Transformer{
>>
>>               inputs:"rules.lex"
>>
>>               Artifact{
>>
>>                   fileName:path+"/ruleslexer.cpp"
>>
>>               }
>>
>>               prepare:{
>>
>>                   var  cmd  =  new  JavaScriptCommand()
>>
>>                   cmd.description  =  "Processing  grammar  lex  and  
>> generate  "+output.filePath
>>
>>                   cmd.highlight  =  "codegen"
>>
>>                   cmd.sourceCode  =  function()  {
>>
>>                       var  lexing  =  new  Process();
>>
>>                       
>> lexing.setWorkingDirectory(FileInfo.path(output.filePath));
>>
>>                       
>> lexing.exec("C:/cygwin/bin/flex.exe",["-v","--noline",input.filePath]);
>>
>>                   }
>>
>>                   return  cmd
>>
>>               }
>>
>>           }
>>
>>
>>
>> _______________________________________________
>> QBS mailing list
>> QBS@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/qbs
>>
> _______________________________________________
> QBS mailing list
> QBS@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qbs
>
_______________________________________________
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs

Reply via email to