Minimal example to run Compiler Explorer with multiple files

276 Views Asked by At

I'd like to use compiler explorer to compile (and possibly run) an application with several files and translation units. Then I'd like to be able to explore the generated assembly, as with the single file scenario.

Here is a (non-working) example.

What would be the procedure to do that?

2

There are 2 best solutions below

1
On BEST ANSWER

There you go: https://godbolt.org/z/s431bE6eY

You need to tell the CMake configuration the "output.s", in your case this would be the cmake target 'multifile', otherwise it does not know which target to run. You can enter it below the field where you entered the cmake arguments.

0
On

You need to add the output file name explicitly in the output field.

Demo