On 03/25/2015 05:12 PM, Alexander Neundorf wrote:
>> rule Fortran_DEPENDS_SCAN
>>   command = f90deps $in $out
>>   description = Write Fortran dependencies to $out
>>
>> rule Fortran_COMPILER
>>   depfile = $DEP_FILE
>>   deps = gcc
>>   command = /usr/bin/f95  $DEFINES $FLAGS -c $in -o $out
>>   description = Building Fortran object $out

Thanks.  I have a similar structure in mind.  I think it will end up
being a bit more complicated because the dependencies have to be
scanned and loaded on the fly.  Currently Ninja loads all depfiles
up front and dependencies generated from scanning are only considered
on the next invocation.  We will need build-time incremental addition
of dependencies and even new build nodes to represent the module
files that sit between providers and consumers.

I'm working on a write-up of the whole thing to present to Ninja
folks.  Once it's drafted I'll post it here for discussion.

>> So, to do a similar thing with cmake, one would need to expose the
>> cmake Fortran dependency scanner so that it can be invoked as e.g.:
>>
>> rule Fortran_DEPENDS_SCAN
>>   command = cmake scan_dependencies $in $out
>>   description = Write Fortran dependencies to $out
>>
>> but I don't know if turning the cmake executable into a build-time
>> dependency scanner is feasible and/or acceptable.
> 
> as Brad wrote, this is already the case for the makefile generator,
> so I guess in general this should be Ok.

Yes, the Makefile generator already uses an undocumented cmake command
line tool to scan dependencies during the build.

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to