Skip to content

Commit

Permalink
Remap x64 processor type to x86_64
Browse files Browse the repository at this point in the history
Ruby compiled for x64-mingw-ucrt appears to return a processor type of
x64, but CMake only understands x86_64.
  • Loading branch information
stanhu committed Jul 18, 2023
1 parent 527a813 commit b8a42de
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/mini_portile2/mini_portile_cmake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
]
Expand Down Expand Up @@ -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

0 comments on commit b8a42de

Please sign in to comment.