From 03e593c72f9d2d70f01bd9d9da37733e3f6f5d81 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Fri, 25 Oct 2024 01:31:38 +0200 Subject: [PATCH] cmake: lowercase ARCH_ID --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 60cda040ae..99ed3c4e6a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -282,7 +282,10 @@ if (NOT ARCH OR ARCH STREQUAL "" OR ARCH STREQUAL "native" OR ARCH STREQUAL "def if(CMAKE_SYSTEM_PROCESSOR STREQUAL "") set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR}) endif() - set(ARCH_ID "${CMAKE_SYSTEM_PROCESSOR}") + # On Windows, CMake sets CMAKE{_HOST,}_SYSTEM_PROCESSOR to the value of the + # PROCESSOR_ARCHITECTURE environment variable. On some systems it may be set to + # AMD64. Lowercase it to ensure checks for "x86_64" or "amd64" work as expected. + string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" ARCH_ID) else() set(ARCH_ID "${ARCH}") endif()