CMake: Support RelWithDebInfo configuration#475
CMake: Support RelWithDebInfo configuration#475bscottm wants to merge 1 commit intoopen-simh:masterfrom
Conversation
Support optimized compiles with debugging info (e.g., "-O2 -g" for GCC/Clang.) Useful with 'valgrind' to produce intelligible output.
16bbaf8 to
c12e617
Compare
| - Multi-configuration builders (`msbuild`, `xcodebuild`): The simulator | ||
| executables will appear underneath individual configuration subdirectories | ||
| ("Debug" and "Release"). | ||
| ("Debug", "Release" and "RelWithDebInfo"). |
There was a problem hiding this comment.
An Oxford comma would be good here, I think. It gets confusing otherwise.
| [string] $flavor = "vs2022", | ||
|
|
||
| ## The target build configuration. Valid values: "Release" and "Debug" | ||
| ## The target build configuration. Valid values: "Release", "Debug" and |
There was a problem hiding this comment.
Oxford comma is less needed here but I'd still recommend it.
There was a problem hiding this comment.
@pmetzger: My writing habits were pretty ingrained by my PhD advisor's admin, who proofed and edited my dissertation. She completely disabused me of writing with Oxford commas. Happy to have a five gin martini debate elsewhere.
There was a problem hiding this comment.
She was wrong. Without an oxford comma, technical documentation becomes ambiguous. https://medium.com/english-language-style-usage/the-oxford-comma-15e3fb65ce21 and many other links will explain the issue.
| mingw | ||
| ucrt | ||
| --config (-c) Specifies the build configuration: 'Release' or 'Debug' | ||
| --config (-c) Specifies the build configuration: 'Release', 'Debug' or |
|
FYI, I've applied a version of this to the ZIMH repository on a branch; see pmetzger/zimh@3b0346c9 |
|
What's amazing to me is how much all of this isn't needed if you just use CMake presets, which have been available since November, 2020. |
|
I'm always happy to get advice from CMake experts. I had no idea that CMake presets existed, but I am not a CMake expert; CMake is a big, complicated system and I don't know enough about using it. Thank you for pointing out their existence. |
|
For the benefit of readers, I'll summarize. The details are all covered in the CMake-Presets documentation. The reason that people write helper scripts, like the powershell script in this PR, is because typing command lines like this more than once becomes tedious: A preset is a JSON file that contains settings that you would normally by typing as command-line arguments above. For instance, the entirety of the above can be accomplished with a workflow preset: The workflow preset defines the steps of configure, build and package: With the corresponding configure preset: and build preset: and package preset: For a small project, this probably suffices, but if you want to get fancier, you can define presets as building blocks and use an inheritance chain to compose presets together. There's also a limited form of macro expansion, access to environment variables and conditional usage of presets (for instance, disabling a preset that is macOS specific on a host environment that isn't macOS). This is why I say that these helper scripts designed to supply repeated arguments to CMake, CTest, and CPack are superfluous. Presets already handle all that. This repository doesn't (yet) have a In addition to making your life at the command-line easier, being a well-defined JSON file with a schema to validate the contents, various IDEs and other tools understand how to parse preset files and can supply you with options in the IDE to say "use this preset". Bespoke helper scripts will never be understood by IDEs and other tooling. |
Support optimized compiles with debugging info (e.g., "-O2 -g" for GCC/Clang.) Useful with 'valgrind' to produce intelligible output.