1*6777b538SAndroid Build Coastguard Worker# rc 2*6777b538SAndroid Build Coastguard Worker 3*6777b538SAndroid Build Coastguard WorkerThis contains a cross-platform reimplementation of rc.exe. 4*6777b538SAndroid Build Coastguard Worker 5*6777b538SAndroid Build Coastguard WorkerThis exists mainly to compile .rc files on non-Windows hosts for cross builds. 6*6777b538SAndroid Build Coastguard WorkerHowever, it also runs on Windows for two reasons: 7*6777b538SAndroid Build Coastguard Worker 8*6777b538SAndroid Build Coastguard Worker1. To compare the output of Microsoft's rc.exe and the reimplementation and to 9*6777b538SAndroid Build Coastguard Worker check that they produce bitwise identical output. 10*6777b538SAndroid Build Coastguard Worker2. The reimplementation supports printing resource files in /showIncludes 11*6777b538SAndroid Build Coastguard Worker output, which helps getting build dependencies right. 12*6777b538SAndroid Build Coastguard Worker 13*6777b538SAndroid Build Coastguard WorkerThe resource compiler consists of two parts: 14*6777b538SAndroid Build Coastguard Worker 15*6777b538SAndroid Build Coastguard Worker1. A python script rc.py that serves as the driver. It does unicode 16*6777b538SAndroid Build Coastguard Worker conversions, runs the input through the preprocessor, and then calls the 17*6777b538SAndroid Build Coastguard Worker actual resource compiler. 18*6777b538SAndroid Build Coastguard Worker2. The resource compiler, a C++ binary obtained via sha1 files from Google 19*6777b538SAndroid Build Coastguard Worker Storage. The binary's code currenty lives at 20*6777b538SAndroid Build Coastguard Worker https://github.com/nico/hack/tree/master/res, even though work is (slowly) 21*6777b538SAndroid Build Coastguard Worker underway to upstream it into LLVM. 22*6777b538SAndroid Build Coastguard Worker 23*6777b538SAndroid Build Coastguard WorkerTo update the rc binary, run `upload_rc_binaries.sh` in this directory, on a 24*6777b538SAndroid Build Coastguard WorkerMac. 25*6777b538SAndroid Build Coastguard Worker 26*6777b538SAndroid Build Coastguard Workerrc isn't built from source as part of the regular chrome build because 27*6777b538SAndroid Build Coastguard Workerit's needed in a gn toolchain tool, and these currently cannot have deps. 28*6777b538SAndroid Build Coastguard WorkerAlternatively, gn could be taught about deps on tools, or rc invocations could 29*6777b538SAndroid Build Coastguard Workerbe not a tool but a template like e.g. yasm invocations (which can have deps), 30*6777b538SAndroid Build Coastguard Workerthen the prebuilt binaries wouldn't be needed. 31