alliedmodders / ambuild

AlliedModders C++ Build System
BSD 3-Clause "New" or "Revised" License
60 stars 31 forks source link

Switch gcc/clang to use -MD for dependency discovery. #123

Closed dvander closed 4 years ago

dvander commented 4 years ago

Currently we use -H for gcc/clang dependency discovery, which has a few problems. The output format is not well defined, it omits command-line headers, and is inconsistent with how precompiled headers are treated.

Using -MD means we have to track an additional output from every gcc or clang job. Cxx tasks now have a "deps" field in the database which can store extended information on how to parse dependencies. For this case, it stores a tuple ('md', md_file).

Lastly, ObjectFile has been renamed to ObjectFileTask. The purpose of this class has always been extremely confusing and this clarifies it a bit.

Bug: fixes issue #65