Skip to content

Commit 75bacee

Browse files
committed
wasi-libc: update targets
1 parent 5176252 commit 75bacee

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

Formula/w/wasi-libc.rb

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,26 @@ def install
5757
"WASM_NM=#{Formula["llvm"].opt_bin}/llvm-nm",
5858
"INSTALL_DIR=#{share}/wasi-sysroot",
5959
]
60+
61+
# See targets at:
62+
# https://github.com/WebAssembly/wasi-sdk/blob/5e04cd81eb749edb5642537d150ab1ab7aedabe9/CMakeLists.txt#L14-L15
63+
targets = %w[
64+
wasm32-wasi
65+
wasm32-wasip1
66+
wasm32-wasip2
67+
wasm32-wasip1-threads
68+
wasm32-wasi-threads
69+
]
70+
71+
# See target flags at:
72+
# https://github.com/WebAssembly/wasi-sdk/blob/5e04cd81eb749edb5642537d150ab1ab7aedabe9/cmake/wasi-sdk-sysroot.cmake#L117-L135
6073
target_flags = Hash.new { |h, k| h[k] = [] }
61-
target_flags["wasm32-wasip1-threads"] << "THREAD_MODEL=posix"
74+
targets.each { |target| target_flags[target] << "THREAD_MODEL=posix" if target.end_with?("-threads") }
6275
target_flags["wasm32-wasip2"] << "WASI_SNAPSHOT=p2"
63-
targets = %w[wasm32-wasi wasm32-wasip1 wasm32-wasip1-threads wasm32-wasip2]
6476

6577
targets.each do |target|
6678
system "make", *make_args, "TARGET_TRIPLE=#{target}", "install", *target_flags[target]
79+
system "make", "clean"
6780
end
6881
end
6982

0 commit comments

Comments
 (0)