Generating assembly code
Completed
Is there a way to automatically generate assembly source code every time I compile?
Please sign in to leave a comment.
Yes, and the syntax depends on the compiler you are using. If you're using `gcc` on Linux, try adding the following to your `CMakeLists.txt`:
Replace `sandbox` with the name of your project. the `-O0` is a fully optimized compile; use `-O3` for unoptimized compile. It will leave *.s files in the `cmake-build-debug` directory.
Be warned that the .s file(s) generated are pretty cryptic (even for assembly).
Oh, and the `main.lst` part will cause a combined C++/assembly listing to be written to `main.lst`