-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[clang-cl] Accept cl
-style output arguments (/Fo
, -Fo
) for --precompile
#121046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sharadhr
wants to merge
6
commits into
llvm:main
Choose a base branch
from
sharadhr:clang-cl-accept-Fo-fmodule-output
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d6c2b9b
Accept /Fo and -Fo in `-fmodule-output` when running under CL mode
sharadhr 59dcf4d
Add a test for the -fmodule-output BMI output file
sharadhr d2e56db
SLASH_Fo and SLASH_Fo_COLON are aliases
sharadhr 8c2edef
Remove `-fmodule-output` from test
sharadhr f139bf1
Formatting fixes
sharadhr 2f7aad6
Add `--` in test
sharadhr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add a test for the -fmodule-output BMI output file
- Loading branch information
commit 59dcf4d9c9218bfbf6da3b7a3b99c055707d477b
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just one invocation, but the logic in GetNamedOutputPath() seems to cover many cases.
Also, is it
-fmodule-output
or/Fo
that sets the output filename (or both?)(Nit: you'll want to put
--
before%t/Hello.cppm
, otherwise it may be interpreted as a command-line option e.g. if the path starts with/Users
.)Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed; once again; open to suggestions for more test cases.
From the Clang user guide, it appears both are required, and CMake in particular uses the 'one-phase compilation' method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the doc:
Your test uses both, with the same filename passed to two different flags. This seems wrong to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coming back after a long while...
Both arguments were provided to exercise CMake's command-line invocation which given this information might be incorrect.
@ChuanqiXu9 are you able to provide more information?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for ignoring this.
--precompile
will be meaningless if it is followed by a-c
. So the command line in cmake's thread actually use-fmodule-output
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't worry too much about what CMake's command-line invocations linked above are doing. CMake doesn't yet support modules with
clang-cl
, and is waiting on the work here. The command lines I posted over there are showing what unmerged changes to CMake are doing in its test suite as part of analyzing why not everything is working. This PR should focus on the functionality inclang-cl
and its test should focus on the documented and intended usage. Once this is merged then CMake can be taught to do the right thing.