An easy way, would be to use the uptodate task to check if any headers have
changed, then touch (to update the timestamp) all your cpp files before your
compilation step. This will cause the compiler to recompile.

http://nant.sourceforge.net/nightly/help/tasks/uptodate.html
http://nant.sourceforge.net/nightly/help/tasks/touch.html

I don't know if the compiler is able to detect dependencies (like header
changes) itself, but this will force it.

HTHs,
Scott
----- Original Message ----- 
From: "Konstantin Sokolovskiy" <[EMAIL PROTECTED]>
> Hello, all.
>
> I am a newbie in Nant so my question may be stupid.
> I try to create .build file for a simple C++ project. It looks like:
>
> <?xml version="1.0"?>
> <project name="HelloWorld" default="build">
>
> [...]
>
>     <target name="build" description="compiles the source code">
> <mkdir dir="${obj.dir}"/>
>
>         <cl outputdir="${obj.dir}" debug="${debug}">
>     <sources>
>                 <includes name="*.cpp"/>
>             </sources>
>         </cl>
>
> <mkdir dir="${build.dir}"/>
> <link output="${build.dir}\helloworld.exe">
> <sources>
>     <includes name="obj\*.obj" />
> </sources>
> </link>
>     </target>
>
> </project>
>
> This build file works fine.
> When I change any of the .cpp files, the project succsessfully recmpiles.
> But when I change any header (*.h) file, it doesn't recompile the project.
> Does Nant provide any ways to trace file dependencies in order to
recompile
> those file, which depend on the changed header files?



-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to