simon-git: msvc-extract (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Thu Apr 15 17:28:54 BST 2021


TL;DR:
  0718df6 Improve option-parsing system.
  22153b2 Move platform / clang_arch detection into main().
  4e56bf2 Try to autodetect target platform from cl itself.
  1007b5a Set $Platform as part of Linux environment setup.
  2825937 Autodetect MSVC version.
  c332994 Add a more helpful usage message.
  ba2ee9e Add a trivial CMakeLists.txt.
  8d6d5b3 Switch to using _stricmp.

Repository:     https://git.tartarus.org/simon/msvc-extract.git
On the web:     https://git.tartarus.org/?p=simon/msvc-extract.git
Branch updated: main
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2021-04-15 17:28:54

commit 0718df62681a270fbc252f763529e6809ef2a113
web diff https://git.tartarus.org/?p=simon/msvc-extract.git;a=commitdiff;h=0718df62681a270fbc252f763529e6809ef2a113;hp=3d969838e249d89c4d5c3ada4bcce4e28873fe6d
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Apr 15 16:51:48 2021 +0100

    Improve option-parsing system.
    
    Now there's a built-in system for extracting the argument value for a
    long option name, and throwing an error if it is there when it
    shouldn't be, or isn't when it should be.
    
    NFC, except that an option like "--help=foo" will now give a more
    specific error message ("option '--help' does not expect a value"
    rather than "unknown option '--help=foo'").

 msvc-extract.c | 49 +++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 45 insertions(+), 4 deletions(-)

commit 22153b2851c188b82c1e8be2a97ec6f84ba2fec7
web diff https://git.tartarus.org/?p=simon/msvc-extract.git;a=commitdiff;h=22153b2851c188b82c1e8be2a97ec6f84ba2fec7;hp=0718df62681a270fbc252f763529e6809ef2a113
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Apr 15 16:54:26 2021 +0100

    Move platform / clang_arch detection into main().
    
    Now it happens first, so that if it's going to throw an error, you
    don't waste a huge amount of time first.

 msvc-extract.c | 43 +++++++++++++++++++++++--------------------
 1 file changed, 23 insertions(+), 20 deletions(-)

commit 4e56bf2b4e6a5721d664aeb561aa2b2540fbe571
web diff https://git.tartarus.org/?p=simon/msvc-extract.git;a=commitdiff;h=4e56bf2b4e6a5721d664aeb561aa2b2540fbe571;hp=22153b2851c188b82c1e8be2a97ec6f84ba2fec7
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Apr 15 16:55:27 2021 +0100

    Try to autodetect target platform from cl itself.
    
    In some situations, it turns out, %Platform% is not set in the
    environment by the MSVC setup scripts. But you can work it out by
    asking the compiler to preprocess a file containing #ifdefs that test
    architecture-id macros like _M_FOO. So we do that as a fallback.

 msvc-extract.c | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 93 insertions(+), 2 deletions(-)

commit 1007b5a003393413b7654b8d0160c789cc991349
web diff https://git.tartarus.org/?p=simon/msvc-extract.git;a=commitdiff;h=1007b5a003393413b7654b8d0160c789cc991349;hp=4e56bf2b4e6a5721d664aeb561aa2b2540fbe571
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Apr 15 16:57:58 2021 +0100

    Set $Platform as part of Linux environment setup.
    
    I've certainly written makefiles in the past which tested it, so let's
    arrange that it's reliably defined.

 msvc-extract.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

commit 28259379757ac510e25e9fd21c49bbeaec28d385
web diff https://git.tartarus.org/?p=simon/msvc-extract.git;a=commitdiff;h=28259379757ac510e25e9fd21c49bbeaec28d385;hp=1007b5a003393413b7654b8d0160c789cc991349
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Apr 15 16:59:20 2021 +0100

    Autodetect MSVC version.
    
    Now, instead of hardcoding -fms-compatibility-version=18.0 into the
    output CMake toolchain file, we hardcode a version number derived from
    the configured compiler where msvc-extract was run, which should mean
    it matches the toolchain you're extracting the headers and libraries
    from.
    
    (There's still a runtime override you can define when using the
    toolchain file; this just changes the default.)
    
    In case cl can't be run, I've provided an --msc-ver option on
    msvc-extract's command line that you can use to set that clang
    argument by hand.

 msvc-extract.c | 29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

commit c332994c8fba964cced1c68b79b8984d41a479d3
web diff https://git.tartarus.org/?p=simon/msvc-extract.git;a=commitdiff;h=c332994c8fba964cced1c68b79b8984d41a479d3;hp=28259379757ac510e25e9fd21c49bbeaec28d385
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Apr 15 17:02:48 2021 +0100

    Add a more helpful usage message.
    
    There are all of three command-line options now, so they should be
    documented in the --help text!

 msvc-extract.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

commit ba2ee9e4e3114e8b2f769d4318d71e7507ed517a
web diff https://git.tartarus.org/?p=simon/msvc-extract.git;a=commitdiff;h=ba2ee9e4e3114e8b2f769d4318d71e7507ed517a;hp=c332994c8fba964cced1c68b79b8984d41a479d3
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Apr 15 17:07:12 2021 +0100

    Add a trivial CMakeLists.txt.
    
    Mostly so I can use my own toolchain files to cross-compile this
    utility, slightly more easily than typing the right clang-cl command
    by hand.

 .gitignore     | 6 ++++++
 CMakeLists.txt | 6 ++++++
 2 files changed, 12 insertions(+)

commit 8d6d5b3e38d010abfc053b63b2e7f35eb31c1996
web diff https://git.tartarus.org/?p=simon/msvc-extract.git;a=commitdiff;h=8d6d5b3e38d010abfc053b63b2e7f35eb31c1996;hp=ba2ee9e4e3114e8b2f769d4318d71e7507ed517a
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Apr 15 17:23:17 2021 +0100

    Switch to using _stricmp.
    
    clang-cl warns that the non-_ spelling is deprecated, presumably on C
    namespace grounds.

 msvc-extract.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)



More information about the tartarus-commits mailing list