• Nico Weber's avatar
    Add a cross-platform resource compiler. · 0c0ade8e
    Nico Weber authored
    Also a stepping stone in getting deps from .rc files correct automatically.
    
    The driver script rc.py works like rc.exe; it supports printing resource
    names on /showIncludes:
    
    $ cat test.rc
    4 ICON "icon.ico"
    $ build/toolchain/win/rc/rc.py /showIncludes test.rc
    Note: including file: ./foo.h
    Note: including file: /Users/thakis/src/chrome/src/icon.ico
    $ file test.res
    test.res: MSVC .res
    
    The driver script behind the scenes calls a deps'd-in "rc" binary.
    This CL includes a script to build new versions of that binary.
    It's ~150kB on Mac and Linux, and ~600kb on Windows.
    
    The compiler isn't hooked up to anything yet. I plan to change
    tool_wrapper.py to call both it and rc.exe in ExecRcWrapper() when
    on Windows (and compare the two outputs and make sure they're identical),
    and to call only rc.py when on non-Windows.
    
    Eventually I also want to make ExecRcWrapper() use rc.py's /showIncludes
    to get dependencies for .rc files right.
    
    The README.md has some more details. We're in the process of slowly
    upstreaming this to LLVM, but it looks like that'll take a while longer,
    so in the meantime let's do this until the LLVM version is ready.
    
    Bug: 774193,132660
    Change-Id: I9a9ee1e271bf403ddb7f8d18ecd97730762c6cbc
    Reviewed-on: https://chromium-review.googlesource.com/727110
    Commit-Queue: Nico Weber <thakis@chromium.org>
    Reviewed-by: default avatarScott Graham <scottmg@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#510244}
    0c0ade8e
rc.py 7.25 KB