Skip to content

Commit 078cb9a

Browse files
committed
fix: improve shim compatibility
1 parent 4bc3478 commit 078cb9a

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

zig-toolchain.cmake

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,18 @@ function(_zig_generate_shim tool_name subcommand inject_flags use_ccache)
221221
message(STATUS "Zig Toolchain: Compiling native wrapper for '${tool_name}'...")
222222

223223
if(CMAKE_HOST_APPLE)
224-
set(_shim_strip_flag "")
224+
set(_shim_compile_cmd
225+
"${_zig_compiler_exe}" cc -O2 -std=c11 -march=native -target native-macos
226+
"${_shim_src}" -o "${_shim_exe}"
227+
)
225228
else()
226-
set(_shim_strip_flag "-s")
229+
set(_shim_compile_cmd
230+
"${_zig_compiler_exe}" cc -O2 -std=c11 -march=native -s
231+
"${_shim_src}" -o "${_shim_exe}"
232+
)
227233
endif()
228234
execute_process(
229-
COMMAND "${_zig_compiler_exe}" cc -O2 ${_shim_strip_flag} "${_shim_src}" -o "${_shim_exe}"
235+
COMMAND ${_shim_compile_cmd}
230236
RESULT_VARIABLE _compile_result
231237
ERROR_VARIABLE _compile_stderr
232238
OUTPUT_QUIET

0 commit comments

Comments
 (0)