Add -rpath when building analyzer executable on macOS

...as at least with LLVM 18 trunk, the generated executable references
@rpath/libclang-cpp.dylib but didn't actually contain an LC_RPATH

Change-Id: Ida643903aa4566853ea9541553f0dfc9c3243d4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157706
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2023-10-09 16:30:10 +02:00
parent 969990becc
commit 646981459d

View file

@ -260,7 +260,9 @@ $(CLANGOUTDIR)/sharedvisitor/sharedvisitor.cxx: $(SHARED_SOURCE_INFOS) $(CLANGOU
# and it can also cause trouble with finding the proper headers.
CLANGTOOLDEFS = $(filter-out -stdlib=%,$(CLANGDEFS) -I$(CLANGSYSINCLUDE))
CLANGTOOLDEFS += -w
ifneq ($(filter-out MACOSX WNT,$(OS)),)
ifneq ($(filter MACOSX,$(OS)),)
CLANGTOOLLIBS += -Wl,-rpath,$(CLANGLIBDIR)
else ifneq ($(filter-out WNT,$(OS)),)
ifneq ($(CLANGDIR),/usr)
# Help the generator find Clang shared libs, if Clang is built so and installed in a non-standard prefix.
CLANGTOOLLIBS += -Wl,--rpath,$(CLANGLIBDIR)