Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new cl.exe dependency report files #868

Closed
waruqi opened this issue Jun 26, 2020 · 5 comments
Closed

Support new cl.exe dependency report files #868

waruqi opened this issue Jun 26, 2020 · 5 comments

Comments

@waruqi
Copy link
Member

waruqi commented Jun 26, 2020

In the cl.exe compiler shipped with Visual Studio 16.7 Preview 3, cl.exe will have a new switch /sourceDependencies [json file name].

ninja-build/ninja#1806
ninja-build/ninja#1766
https://github.com/ninja-build/ninja/pull/1812/files/48275bf8b04f4b2352d9c1e2ea7213b2ff9fde1d..00fe279c0c23396cf77a5d06073a1a23085506a6

@OpportunityLiu
Copy link
Member

所以还是赶紧弄个正经的JSON库进来吧

@waruqi
Copy link
Member Author

waruqi commented Jul 15, 2020

是会弄个的 不过得等等 最近没啥时间

@waruqi
Copy link
Member Author

waruqi commented Jul 15, 2020

json的调研和集成后期到这里跟进:#893

@waruqi
Copy link
Member Author

waruqi commented Jul 17, 2020

所以还是赶紧弄个正经的JSON库进来吧

我加上了

@waruqi
Copy link
Member Author

waruqi commented Jul 27, 2020

我初步支持上了,/sourceDependences 解析,初步看了下,似乎默认所有系统头文件也会带进来,没看到像gcc/clang那样可指定只生成项目的includes,这样可以减少不少输出量,提高处理和编译效率。

先这样吧,回头有问题再改进

输出内容大概长这样:

{
    "Version": "1.0",
    "Data": {
        "Source": "z:\\personal\\tbox\\src\\tbox\\tbox.c",
        "Includes": [
            "z:\\personal\\tbox\\src\\tbox\\tbox.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\prefix.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\config.h",
            "z:\\personal\\tbox\\src\\tbox\\config.h",
            "z:\\personal\\tbox\\build\\windows\\x64\\release\\tbox.config.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\cpu.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\arch.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\keyword.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\compiler.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\type.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\limits.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\endian.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\version.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\assembler.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\trace.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\abort.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\check.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\assert.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\malloc.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\utils.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\state.h",
            "z:\\personal\\tbox\\src\\tbox\\prefix\\cache.h",
            "z:\\personal\\tbox\\src\\tbox\\zip\\zip.h",
            "z:\\personal\\tbox\\src\\tbox\\zip\\prefix.h",
            "z:\\personal\\tbox\\src\\tbox\\stream\\static_stream.h",
            "z:\\personal\\tbox\\src\\tbox\\stream\\prefix.h",
            "z:\\personal\\tbox\\src\\tbox\\libc\\libc.h",
            "z:\\personal\\tbox\\src\\tbox\\libc\\prefix.h",
            "z:\\personal\\tbox\\src\\tbox\\libc\\misc\\ctype.h",
            "z:\\personal\\tbox\\src\\tbox\\libc\\misc\\prefix.h",
            "z:\\personal\\tbox\\src\\tbox\\libc\\prefix.h",
            "z:\\personal\\tbox\\src\\tbox\\libc\\misc\\limits.h",
            "z:\\personal\\tbox\\src\\tbox\\libc\\misc\\stdarg.h",
            "c:\\program files (x86)\\microsoft visual studio\\2019\\preview\\vc\\tools\\msvc\\14.27.29109\\include\\stdarg.h",
            "c:\\program files (x86)\\microsoft visual studio\\2019\\preview\\vc\\tools\\msvc\\14.27.29109\\include\\vcruntime.h",
            "c:\\program files (x86)\\microsoft visual studio\\2019\\preview\\vc\\tools\\msvc\\14.27.29109\\include\\sal.h",
            "c:\\program files (x86)\\microsoft visual studio\\2019\\preview\\vc\\tools\\msvc\\14.27.29109\\include\\concurrencysal.h",
            "c:\\program files (x86)\\microsoft visual studio\\2019\\preview\\vc\\tools\\msvc\\14.27.29109\\include\\vadefs.h",
        ],
        "Modules": []
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants