diff options
author | pastdue <30769-past-due@users.noreply.gitlab.kitware.com> | 2021-01-22 21:07:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-01-25 17:15:43 (GMT) |
commit | 9c5cf0c1af93216f09c5c6bbf543a5f0bcea0dac (patch) | |
tree | 88d150849af4a8110102487806d400d7e341aa6a | |
parent | 6bd251ace7a11d57fd250c8c4a89d480b10d664d (diff) | |
download | CMake-9c5cf0c1af93216f09c5c6bbf543a5f0bcea0dac.zip CMake-9c5cf0c1af93216f09c5c6bbf543a5f0bcea0dac.tar.gz CMake-9c5cf0c1af93216f09c5c6bbf543a5f0bcea0dac.tar.bz2 |
IRSL: Add support for non-x86/x64 architectures such as arm64
Implement `CMAKE_MSVC_ARCH` determination for more architectures.
Fixes: #16734
-rw-r--r-- | Modules/InstallRequiredSystemLibraries.cmake | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index 6ecdb9c..a39393dc 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -101,16 +101,18 @@ endforeach() if(MSVC) file(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT) - if(CMAKE_CL_64) - if(MSVC_VERSION GREATER 1599) - # VS 10 and later: - set(CMAKE_MSVC_ARCH x64) - else() + if(MSVC_C_ARCHITECTURE_ID) + string(TOLOWER "${MSVC_C_ARCHITECTURE_ID}" CMAKE_MSVC_ARCH) + elseif(MSVC_CXX_ARCHITECTURE_ID) + string(TOLOWER "${MSVC_CXX_ARCHITECTURE_ID}" CMAKE_MSVC_ARCH) + else() + set(CMAKE_MSVC_ARCH x86) + endif() + if(CMAKE_MSVC_ARCH STREQUAL "x64") + if(MSVC_VERSION LESS 1600) # VS 9 and earlier: set(CMAKE_MSVC_ARCH amd64) endif() - else() - set(CMAKE_MSVC_ARCH x86) endif() get_filename_component(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH) |