Skip to content

Commit 08e301d

Browse files
authored
Merge pull request #471 from YO4/clang64
preliminary support for clang64
2 parents d5fdda3 + d6b6db8 commit 08e301d

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

lib/ruby_installer/build/components/03_dev_tools.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def description
5252
'mingw32' => PACKAGES_MINGW32,
5353
'mingw64' => PACKAGES_MINGW64,
5454
'ucrt64' => PACKAGES_MINGW64,
55+
'clang64' => PACKAGES_MINGW64,
5556
'clangarm64' => PACKAGES_MINGW64,
5657
}
5758

lib/ruby_installer/build/msys2_installation.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def initialize(msys_path: nil, mingwarch: nil, mingw_package_prefix: nil, ruby_b
3535
when 'mingw32' then "mingw-w64-i686"
3636
when 'mingw64' then "mingw-w64-x86_64"
3737
when 'ucrt64' then "mingw-w64-ucrt-x86_64"
38+
when 'clang64' then "mingw-w64-clang-x86_64"
3839
when 'clangarm64' then "mingw-w64-clang-aarch64"
3940
else raise "unknown mingwarch #{@mingwarch.inspect}"
4041
end
@@ -188,6 +189,12 @@ def disable_dll_search_paths
188189
vars['MSYSTEM_CHOST'] = 'x86_64-w64-mingw32'
189190
vars['MINGW_CHOST'] = vars['MSYSTEM_CHOST']
190191
vars['MINGW_PREFIX'] = vars['MSYSTEM_PREFIX']
192+
when 'clang64'
193+
vars['MSYSTEM_PREFIX'] = '/clang64'
194+
vars['MSYSTEM_CARCH'] = 'x86_64'
195+
vars['MSYSTEM_CHOST'] = 'x86_64-w64-mingw32'
196+
vars['MINGW_CHOST'] = vars['MSYSTEM_CHOST']
197+
vars['MINGW_PREFIX'] = vars['MSYSTEM_PREFIX']
191198
when 'clangarm64'
192199
vars['MSYSTEM_PREFIX'] = '/clangarm64'
193200
vars['MSYSTEM_CARCH'] = 'aarch64'

lib/ruby_installer/runtime/ridk.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ def print_logo
5454
DEFAULT_COMPONENTS = %w[1 3]
5555

5656
def install(args)
57-
ci = ComponentsInstaller.new
57+
if args && %w[ucrt64 mingw64 mingw32 clang64 clangarm64].include?(args[0])
58+
msys = Msys2Installation.new(mingwarch: args.shift)
59+
end
60+
ci = ComponentsInstaller.new(msys:)
5861
inst_defaults = DEFAULT_COMPONENTS
5962

6063
if args.empty?

0 commit comments

Comments
 (0)