From 91f8ffa716214ae3f69dabc44b02ab6deba273b7 Mon Sep 17 00:00:00 2001 From: Renata Hodovan Date: Wed, 8 Oct 2025 13:08:23 +0200 Subject: [PATCH] cmake: avoid Apple ranlib flags when not using AppleClang On macOS, `-no_warning_for_no_symbols -c` options are specific to the Apple `ranlib` tool. When using other toolchains (e.g. Homebrew clang), these flags cause errors since `llvm-ranlib` does not recognize them. The patch ensures these flags are only passed when using AppleClang. JerryScript-DCO-1.0-Signed-off-by: Renata Hodovan reni@inf.u-szeged.hu --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 314d5adaa8..3adfb34d3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -209,7 +209,11 @@ endif() if("${PLATFORM}" STREQUAL "DARWIN") jerry_add_link_flags(-lSystem) set(CMAKE_C_ARCHIVE_CREATE " Sqc ") - set(CMAKE_C_ARCHIVE_FINISH " -no_warning_for_no_symbols -c ") + if("${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") + set(CMAKE_C_ARCHIVE_FINISH " -no_warning_for_no_symbols -c ") + else() + set(CMAKE_C_ARCHIVE_FINISH " ") + endif() set(CMAKE_SHARED_LINKER_FLAGS "-undefined dynamic_lookup") elseif((NOT CYGWIN AND NOT MINGW AND NOT MSYS) AND (USING_GCC OR USING_CLANG)) jerry_add_link_flags(-Wl,-z,noexecstack)