stl/CMakeLists.txt
: Fix add_compile_options()
ordering
#3402
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Our
ASM_MASM
options were being ignored (!) because they appeared afteradd_library()
. This was visible in the output because/nologo
was missing, we just didn't notice. (See output below.) This regression happened in #2780.To fix this and prevent any recurrence, I'm slightly reorganizing this file. First, I'm introducing 3 prominent box comments, dividing the file into clear sections. The actual fix is to move
add_compile_options()
up. Finally, I'm movingadd_compile_definitions()
down slightly, so that the compile definitions, compile options, and include directories are grouped together.I've additionally verified the fix by looking at the verbose build output; our desired options are now being passed to MASM.
Before
After
Note
I've implemented a
/quiet
option for MASM in VS 2022 17.7 Preview 1 that will allow the "Assembling" messages to be suppressed, making the output here ideal - that's how I discovered this.