From b8a42de36fe156670e18459a06b3eaa96b15f85a Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 18 Jul 2023 00:06:59 -0700 Subject: [PATCH] Remap x64 processor type to x86_64 Ruby compiled for x64-mingw-ucrt appears to return a processor type of x64, but CMake only understands x86_64. --- lib/mini_portile2/mini_portile_cmake.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/mini_portile2/mini_portile_cmake.rb b/lib/mini_portile2/mini_portile_cmake.rb index 81c4158..8543645 100644 --- a/lib/mini_portile2/mini_portile_cmake.rb +++ b/lib/mini_portile2/mini_portile_cmake.rb @@ -67,7 +67,7 @@ def cmake_compile_flags # needed to ensure cross-compilation with CMake targets the right CPU and compilers [ "-DCMAKE_SYSTEM_NAME=#{cmake_system_name}", - "-DCMAKE_SYSTEM_PROCESSOR=#{MiniPortile.target_cpu}", + "-DCMAKE_SYSTEM_PROCESSOR=#{cpu_type}", "-DCMAKE_C_COMPILER=#{c_compiler}", "-DCMAKE_CXX_COMPILER=#{cxx_compiler}" ] @@ -129,4 +129,10 @@ def generator_available?(generator_type) stdout_str.include?("#{generator_type} Makefiles") end + + def cpu_type + return 'x86_64' if MiniPortile.target_cpu == 'x64' + + MiniPortile.target_cpu + end end