mirror of
https://github.com/apache/nuttx.git
synced 2026-10-07 22:35:22 +00: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:
parent
d9f6216f30
commit
d701340cb6
2 changed files with 15 additions and 2 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue