Open falhumai96 opened 2 years ago
@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 :grinning:.
Anyhow, @wsfulton, what do you mean by documentation from https://github.com/swig/cccl/pull/14#issuecomment-1057474889? I added some comments above my code implementation to indicate the purpose of the command-line arguments.
Recreated the pull request from https://github.com/swig/cccl/pull/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 toarmv7
ori386
, respectfully (since there are many ARM or X86 archetectures).dumpmachine
is similer to that ofgcc
/clang
's command of the same name.dumpmachinefull
, which has the same output asdumpmachine
, 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 ifdumpmachine
/dumpmachinefull
is processed, it will print the target triplet and exit succefully (the first ofdumpmachine
ordumpmachinefull
will be processed).