File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -759,10 +759,21 @@ IF (BUNDLED_POLYGLOT_DIR)
759
759
FIND_LIBRARY (POLYGLOT_LIBRARY
760
760
NAMES
761
761
polyglot
762
+ libpolyglot
762
763
HINTS
763
764
"${BUNDLED_POLYGLOT_DIR} "
764
765
NO_DEFAULT_PATH )
765
766
767
+ IF (APPLE )
768
+ # reset the ID to something predictible
769
+ get_filename_component (POLYGLOT_LIBRARY_NAME "${POLYGLOT_LIBRARY} " NAME )
770
+ EXECUTE_PROCESS (COMMAND install_name_tool -id "${POLYGLOT_LIBRARY_NAME} " "${POLYGLOT_LIBRARY} " RESULT_VARIABLE COMMAND_RESULT )
771
+
772
+ IF (NOT "${COMMAND_RESULT} " STREQUAL "0" )
773
+ MESSAGE (FATAL_ERROR "Failed to execute: install_name_tool -id ${POLYGLOT_LIBRARY_NAME} ${POLYGLOT_LIBRARY} " )
774
+ ENDIF ()
775
+ ENDIF ()
776
+
766
777
INCLUDE_DIRECTORIES (SYSTEM "${BUNDLED_POLYGLOT_DIR} " )
767
778
MESSAGE (STATUS "Polyglot Library: ${POLYGLOT_LIBRARY} " )
768
779
SET (HAVE_JS 1 )
Original file line number Diff line number Diff line change @@ -89,6 +89,13 @@ function(add_shell_executable)
89
89
"${ANTLR4_LIB_FILENAME} " "@loader_path/../${INSTALL_LIBDIR} /${ANTLR4_LIB_FILENAME} "
90
90
$< TARGET_FILE:${ARGV0} > )
91
91
endif ()
92
+ if (BUNDLED_POLYGLOT_DIR )
93
+ add_custom_command (TARGET "${ARGV0} " POST_BUILD
94
+ COMMAND install_name_tool -change
95
+ "${POLYGLOT_LIBRARY_NAME} " "@loader_path/../${INSTALL_LIBDIR} /${POLYGLOT_LIBRARY_NAME} "
96
+ $< TARGET_FILE:${ARGV0} >
97
+ )
98
+ endif ()
92
99
elseif (NOT WIN32 )
93
100
if (BUNDLED_OPENSSL OR BUNDLED_SHARED_PYTHON OR BUNDLED_SSH_DIR OR BUNDLED_KRB5_DIR OR BUNDLED_ANTLR_DIR OR BUNDLED_SASL_DIR )
94
101
# newer versions of linker enable new dtags by default, causing -Wl,-rpath to create RUNPATH
You can’t perform that action at this time.
0 commit comments