Attempt to fix finding libedit on macOS (#609)

First pass at trying to fix this...
pull/611/head
Alex Crichton 5 months ago committed by GitHub
parent 015c849728
commit 5d5c6c0d18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -113,6 +113,9 @@ if(WASI_SDK_LLDB)
include(ProcessorCount)
ProcessorCount(nproc)
find_program(MAKE_EXECUTABLE make REQUIRED)
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(libedit_ldflags -Wl,-install_name,@rpath/libedit.0.dylib)
endif()
ExternalProject_Add(libedit
URL https://thrysoee.dk/editline/libedit-20251016-3.1.tar.gz
URL_HASH SHA256=21362b00653bbfc1c71f71a7578da66b5b5203559d43134d2dd7719e313ce041
@ -127,8 +130,7 @@ if(WASI_SDK_LLDB)
--enable-pic
--disable-examples
CC=${CMAKE_C_COMPILER}
CFLAGS=${libedit_cflags}
LDFLAGS=${libedit_cflags}
LDFLAGS=${libedit_ldflags}
BUILD_COMMAND
${MAKE_EXECUTABLE} -j${nproc} V=1
@ -169,6 +171,9 @@ ExternalProject_Add(llvm-build
# Pass `-s` to strip symbols by default and shrink the size of the
# distribution
-DCMAKE_EXE_LINKER_FLAGS=-s
# Looks to be required on macOS for, at build time, the dynamic linker to
# find `libedit.dylib` when that's enabled.
-DCMAKE_BUILD_RPATH=${wasi_tmp_install}/lib
${llvm_cmake_flags_list}
# See https://www.scivision.dev/cmake-externalproject-list-arguments/ for
# why this is in `CMAKE_CACHE_ARGS` instead of above

Loading…
Cancel
Save