Skip to content
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

Add "dumpmachine"/"dumpmachinefull" arguments to get the target machine triplet ("dumpmachinefull" for the full MSVC version). #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

falhumai96
Copy link

Recreated the pull request from #14, as I needed to change the source branch in my fork.

Add two new command-line arguments to get the target machine's triplet, by parsing the command-line output of cl:
* dumpmachine, which is to get the base machine triplet in the format {arch}-pc-windows-msvc, where {arch} is the target archetecture. If the target architecture is ARM or X86, {arch} will be set to armv7 or i386, respectfully (since there are many ARM or X86 archetectures). dumpmachine is similer to that of gcc/clang's command of the same name.
* dumpmachinefull, which has the same output as dumpmachine, except it is post-fixed by the full MSVC version being used. In other words, the command-line argument has the following format {arch}-pc-windows-msvc{msvcver}, where {arch} is the target archetecture and {msvcver} is the MSVC version.

These arguments precede any other arguments passed to cccl, and if dumpmachine/dumpmachinefull is processed, it will print the target triplet and exit succefully (the first of dumpmachine or dumpmachinefull will be processed).

…ne triplet ("dumpmachinefull" for the full MSVC version).
…umpmachine" or "dumpmachinefull". Use "case" instead of chain of "if-elif-else" blocks for converting the MSVC architecture to CC architecture. Add comments documenting the code changes, especially for why I chose "i386" and "armv7" CC architectures for "X86" and "ARM" MSVC architectures, respectfully.
…l". Move the code bellow "prog" definition to use that variable in the calling of the command when processing "dumpmachine"/"dumpmachinefull".
@falhumai96
Copy link
Author

@vadz @wsfulton I dropped the last PR and recreated it because I needed to change the source branch from falhumai96:master to falhumai96:implement-dumpmachine, as I have another incoming change 😀.

Anyhow, @wsfulton, what do you mean by documentation from #14 (comment)? I added some comments above my code implementation to indicate the purpose of the command-line arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant