Skip to content

Commit

Permalink
Support windows-arm64 (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme authored Mar 19, 2024
1 parent d861463 commit b04e5a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ jobs:
platform: x86-linux-musl
- os: ubuntu-latest
platform: x86_64-linux-musl
- os: windows-latest
platform: aarch64-mingw-ucrt
- os: windows-latest
platform: x64-mingw-ucrt
- os: windows-latest
Expand Down
20 changes: 10 additions & 10 deletions ext/sass/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ module SassConfig
when /amd64|x86_64|x64/
'x86_64'
when /i\d86|x86|i86pc/
'i386'
'x86'
when /arm64|aarch64/
'aarch64'
when /arm/
Expand All @@ -259,8 +259,6 @@ module SassConfig
end

ARCH = "#{CPU}-#{OS}".freeze

EMULATION = ('x86_64' if ARCH == 'aarch64-windows')
end

private_constant :Platform
Expand Down Expand Up @@ -300,8 +298,8 @@ module SassConfig
raise NotImplementedError, message
end

cpu = case Platform::EMULATION || Platform::CPU
when 'i386'
cpu = case Platform::CPU
when 'x86'
'ia32'
when 'x86_64'
'x64'
Expand Down Expand Up @@ -342,8 +340,8 @@ module SassConfig
raise NotImplementedError, message
end

cpu = case Platform::EMULATION || Platform::CPU
when 'i386'
cpu = case Platform::CPU
when 'x86'
'x86_32'
when 'x86_64'
'x86_64'
Expand Down Expand Up @@ -407,7 +405,7 @@ module SassConfig
end

def gem_platform
platform = Gem::Platform.new("#{Platform::EMULATION || Platform::CPU}-#{RbConfig::CONFIG['host_os']}")
platform = Gem::Platform.new("#{Platform::CPU}-#{RbConfig::CONFIG['host_os']}")
case Platform::OS
when 'darwin'
Gem::Platform.new([RbConfig::CONFIG['host_cpu'], platform.os])
Expand All @@ -419,10 +417,12 @@ module SassConfig
end
when 'windows'
case platform.cpu
when 'x86'
Gem::Platform.new('x86-mingw32')
when 'x86_64'
Gem::Platform.new('x64-mingw32')
Gem::Platform.new('x64-mingw-ucrt')
else
Gem::Platform.new([platform.cpu, 'mingw32'])
Gem::Platform.new([platform.cpu, 'mingw', 'ucrt'])
end
else
platform
Expand Down

0 comments on commit b04e5a3

Please # to comment.