I am trying to run codeql on Chromium among a few other open-source software, and I was wondering if it is possible to compile a single file from the full source code, because my machine takes a long time to compile such huge codebases.
For example, is it possible to compile the media/filters/ffmpeg_video_decoder.cc
file only?
Compiling is not the issue. If you only compile one source file, it will be missing several functions that would be added to the final binary in the linker phase.
https://en.wikipedia.org/wiki/Linker_(computing)
Only compiling one file will (most probably) not make a working binary, as you need a
main
function along with all the other code.From a quick
CTRL-F
through the source code, amain
function, which is critical for the program to run, is absent from the file you mentioned, so you definitely won't be able to make a working executable.If you're making a
.lib
(library) file, it might work, although you're almost certainly going to run into undefined references, as the code is broken apart among many files.