mirror of
https://github.com/apache/nuttx.git
synced 2026-09-23 15:46:09 +08:00
fix(sim): fix cmake build on macOS
macOS /usr/bin/ar does not understand the @rsp syntax used in CMake. Using LLVM binutils instead. Signed-off-by: bijunda <bijunda@bytedance.com>
This commit is contained in:
@@ -21,8 +21,20 @@
|
||||
# ##############################################################################
|
||||
|
||||
if(APPLE AND CONFIG_SIM_TOOLCHAIN_GCC)
|
||||
find_program(CMAKE_C_ELF_COMPILER x86_64-elf-gcc)
|
||||
find_program(CMAKE_CXX_ELF_COMPILER x86_64-elf-g++)
|
||||
if(CONFIG_HOST_ARM64)
|
||||
find_program(CMAKE_C_ELF_COMPILER aarch64-elf-gcc)
|
||||
find_program(CMAKE_CXX_ELF_COMPILER aarch64-elf-g++)
|
||||
else()
|
||||
find_program(CMAKE_C_ELF_COMPILER x86_64-elf-gcc)
|
||||
find_program(CMAKE_CXX_ELF_COMPILER x86_64-elf-g++)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Ninja archives large object lists through response files. Use LLVM binutils
|
||||
# because macOS /usr/bin/ar does not understand the @rsp syntax.
|
||||
if(APPLE)
|
||||
find_program(CMAKE_AR NAMES llvm-ar REQUIRED)
|
||||
find_program(CMAKE_RANLIB NAMES llvm-ranlib REQUIRED)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
|
||||
@@ -156,6 +156,7 @@ list(
|
||||
if(CONFIG_HOST_MACOS)
|
||||
if(CONFIG_HAVE_CXXINITIALIZE)
|
||||
list(APPEND HOSTSRCS sim_macho_init.c)
|
||||
target_link_options(nuttx PRIVATE -Wl,-ld_classic,-no_fixup_chains)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user