Coder Social home page Coder Social logo

Comments (9)

ccmvn avatar ccmvn commented on June 29, 2024 1

@NeroBurner These proposed changes seem to be logical and future-proof. Making the comparisons in hunter_setup_msvc.cmake case-insensitive for the input variables MSVC_CXX_ARCHITECTURE_ID and CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE is a wise move to prevent inconsistencies.

Also, the idea of using all lower case keywords for the HUNTER_MSVC_ARCH, HUNTER_MSVC_ARCH_HOST, and HUNTER_MSVC_ARCH_TARGET set hunter variables is a sound decision.

This should restore compatibility with older toolchains comparing against HUNTER_MSVC_ARCH==arm64 and hopefully reduce confusion in the future.

Just to add a bit here, when I first put this together, I was really just trying to get a quick fix in place because we needed it pronto. I didn't have much time to polish it up as much as I would have liked.

Unless there are specific concerns I might be overlooking, it seems like these changes are a solid step forward.

from hunter.

NeroBurner avatar NeroBurner commented on June 29, 2024

@ccmvn could you also run C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build>vcvarsall.bat /help to maybe get the right arm64ce architecture argument

from hunter.

ccmvn avatar ccmvn commented on June 29, 2024

@ccmvn could you also run C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build>vcvarsall.bat /help to maybe get the right arm64ce architecture argument

C:\Users\Admin>"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" /help
Syntax:
    vcvarsall.bat [arch] [platform_type] [winsdk_version] [-vcvars_ver=vc_version] [-vcvars_spectre_libs=spectre_mode]
where :
    [arch]: x86 | amd64 | x86_amd64 | x86_arm | x86_arm64 | amd64_x86 | amd64_arm | amd64_arm64
    [platform_type]: {empty} | store | uwp
    [winsdk_version] : full Windows 10 SDK number (e.g. 10.0.10240.0) or "8.1" to use the Windows 8.1 SDK.
    [vc_version] : {none} for latest installed VC++ compiler toolset |
                   "14.0" for VC++ 2015 Compiler Toolset |
                   "14.xx" for the latest 14.xx.yyyyy toolset installed (e.g. "14.11") |
                   "14.xx.yyyyy" for a specific full version number (e.g. "14.11.25503")
    [spectre_mode] : {none} for libraries without spectre mitigations |
                     "spectre" for libraries with spectre mitigations

The store parameter sets environment variables to support Universal Windows Platform application
development and is an alias for 'uwp'.

For example:
    vcvarsall.bat x86_amd64
    vcvarsall.bat x86_amd64 10.0.10240.0
    vcvarsall.bat x86_arm uwp 10.0.10240.0
    vcvarsall.bat x86_arm onecore 10.0.10240.0 -vcvars_ver=14.0
    vcvarsall.bat x64 8.1
    vcvarsall.bat x64 store 8.1

Please make sure either Visual Studio or C++ Build SKU is installed.

C:\Users\Admin>

from hunter.

NeroBurner avatar NeroBurner commented on June 29, 2024

so no change in the help message even though you installed the ARM64CE support

could you configure the following CMakeLists.txt file with the different target architectures? With the right vsdevcmd.bat calls beforehand

cmake -S . -B build -G "Visual Studio 17 2022" -A ARM64CE
cmake -S . -B build -G "Visual Studio 17 2022" -A ARM64
cmake -S . -B build -G "Visual Studio 17 2022" -A x64
cmake -S . -B build -G "Visual Studio 17 2022" -A x86
cmake_minimum_required(VERSION 3.5)
project(PrintVar CXX)
message(STATUS "MSVC_CXX_ARCHITECTURE_ID: ${MSVC_CXX_ARCHITECTURE_ID}")

note: please use ``` around the code to highlight them as code-blocks, something like the following

```
some code you want to
highlight in a verbatim font
```

from hunter.

NeroBurner avatar NeroBurner commented on June 29, 2024

tested it for x86, amd64 and arm64. I couldn't get ARM64EC to work (neither with vcvarsall.bat nor with a cmake -A flag).

vcvarsall.bat and cmake -A both don't care about capitalization. But their output has differing capitalization (or keywords)

All Tests ran on an Windows 10 amd64 Host with MSVC Build Tools 2022

|-------------------|----------------------------|---------------|--------------------------|
| vcvarsall.bat     | vcvars initialized for msg | cmake -A      | MSVC_CXX_ARCHITECTURE_ID |
|-------------------|----------------------------|---------------|--------------------------|
| x86               | x86                        | WIN32         | X86                      |
|-------------------|----------------------------|---------------|--------------------------|
| amd64             | x64                        | x64           | x64                      |
| AMD64             | x64                        | x64           | x64                      |
| x64               | x64                        | x64           | x64                      |
| amd64             | x64                        | X64           | x64                      |
| amd64             | x64                        | amd64         | ERROR                    |
| amd64_amd64       | ERROR                      |               |                          |
|-------------------|----------------------------|---------------|--------------------------|
| amd64_arm64       | x64_arm64                  | ARM64         | ARM64                    |
| AMD64_ARM64       | x64_arm64                  | ARM64         | ARM64                    |
| amd64_arm64       | x64_arm64                  | arm64         | ARM64                    |
| arm64             | arm64                      | ARM64         | ARM64                    |
|-------------------|----------------------------|---------------|--------------------------|
| arm64ec           | ERROR                      |               |                          |
| arm64             | arm64                      | ARM64EC       | ARM64EC                  |
| arm64             | arm64                      | arm64ec       | ARM64EC                  |
|-------------------|----------------------------|---------------|--------------------------|

a small print_variables_x64.bat looks as follows:

call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars32.bat" ^
  amd64
cmake -E rm -r -f build_x64
cmake -S . -B build_x64 -G "Visual Studio 17 2022" -A x64
pause

And then I just double click the bat file from the Explorer and get the wanted output

edit: fixed ARM64EC (not ARM64CE)

edit2: updated the working state of ARM64EC in the table

from hunter.

ccmvn avatar ccmvn commented on June 29, 2024
The C compiler identification is MSVC 19.36.32532.0
The CXX compiler identification is MSVC 19.36.32532.0
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.36.32532/bin/Hostarm64/arm64/cl.exe - skipped
Detecting C compile features
Detecting C compile features - done
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.36.32532/bin/Hostarm64/arm64/cl.exe - skipped
Detecting CXX compile features
Detecting CXX compile features - done
MSVC_CXX_ARCHITECTURE_ID: ARM64EC
Configuring done

Sorry for the late reply I was busy at work @NeroBurner My mistake I must have made a typo

from hunter.

NeroBurner avatar NeroBurner commented on June 29, 2024

Ah thanks for the ARM64EC clarification. I updated the table above with the working combination

from hunter.

ccmvn avatar ccmvn commented on June 29, 2024

Ah thanks for the ARM64EC clarification. I updated the table above with the working combination

Perfect! Thank you

from hunter.

NeroBurner avatar NeroBurner commented on June 29, 2024

I'll update the comparisons in hunter_setup_msvc.cmake of the input variables MSVC_CXX_ARCHITECTURE_ID and CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE to be case insensitive (using a string(TOLOWER) call before comparison).
And I'll use all lower case keywords for the set hunter variables HUNTER_MSVC_ARCH, HUNTER_MSVC_ARCH_HOST and HUNTER_MSVC_ARCH_TARGET.
Then the old toolchains compairing against HUNTER_MSVC_ARCH==arm64 should work again and we will hopefully have less confusion in the future.

@ccmvn are you OK with those changes, or am I missing something important?

from hunter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.