diff --git a/clang/cmake/caches/release_cpack_pre_build_strip_lto.cmake b/clang/cmake/caches/release_cpack_pre_build_strip_lto.cmake index 743b64fe00f58..e7d8830515439 100644 --- a/clang/cmake/caches/release_cpack_pre_build_strip_lto.cmake +++ b/clang/cmake/caches/release_cpack_pre_build_strip_lto.cmake @@ -1,5 +1,14 @@ file(GLOB files ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/lib/*.a) +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(strip_command + ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/bin/llvm-bitcode-strip) + set(strip_args -r) +else() + set(strip_command ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/bin/llvm-strip) + set(strip_args --no-strip-all -R .llvm.lto) +endif() + foreach(file ${files}) - execute_process(COMMAND ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/bin/llvm-strip --no-strip-all -R .llvm.lto ${file}) + execute_process(COMMAND ${strip_command} ${strip_args} ${file} -o ${file}) endforeach()