stl/CMakeLists.txt: Fix add_compile_options() ordering#3402
Merged
StephanTLavavej merged 2 commits intomicrosoft:mainfrom Feb 14, 2023
Merged
stl/CMakeLists.txt: Fix add_compile_options() ordering#3402StephanTLavavej merged 2 commits intomicrosoft:mainfrom
stl/CMakeLists.txt: Fix add_compile_options() ordering#3402StephanTLavavej merged 2 commits intomicrosoft:mainfrom
Conversation
Our ASM_MASM options were being ignored (!) because they appeared after add_library(). This was visible in the output because /nologo was missing, we just didn't notice. 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 moving add_compile_definitions() down slightly, so that the compile definitions, compile options, and include directories are grouped together.
CaseyCarter
approved these changes
Feb 11, 2023
strega-nil-ms
suggested changes
Feb 13, 2023
Contributor
strega-nil-ms
left a comment
There was a problem hiding this comment.
Thanks for the changes! Approve once suggestions are complete.
strega-nil-ms
approved these changes
Feb 13, 2023
CaseyCarter
approved these changes
Feb 13, 2023
Member
Author
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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_MASMoptions were being ignored (!) because they appeared afteradd_library(). This was visible in the output because/nologowas 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
/quietoption 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.