Skip to content

Commit e2b815e

Browse files
committed
Enable Metal for launch speedup (PoE 2)
The upstream vcpkg angle port produces dylibs with a double "lib" prefix and "_angle" suffix on macOS (liblibEGL_angle.dylib). Our launcher and GLFW expect the standard names (libEGL.dylib / libGLESv2.dylib). Post-install rename + install_name_tool fixup resolves this until the upstream port is patched.
1 parent bbc20ed commit e2b815e

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,27 @@ install(TARGETS PathOfBuilding
119119
RUNTIME DESTINATION "${POB_BIN_DEST}"
120120
)
121121

122+
# The upstream vcpkg angle port produces dylibs named liblibEGL_angle.dylib
123+
# and liblibGLESv2_angle.dylib (double "lib" prefix + "_angle" suffix). Our
124+
# launcher and GLFW dlopen by the standard names (libEGL / libGLESv2), so we
125+
# rename, fix install names, and patch cross-references after install.
126+
install(CODE "
127+
set(_bd \"\${CMAKE_INSTALL_PREFIX}/${POB_BIN_DEST}\")
128+
if (EXISTS \"\${_bd}/liblibEGL_angle.dylib\")
129+
file(RENAME \"\${_bd}/liblibEGL_angle.dylib\" \"\${_bd}/libEGL.dylib\")
130+
execute_process(COMMAND install_name_tool -id @rpath/libEGL.dylib \"\${_bd}/libEGL.dylib\")
131+
endif()
132+
if (EXISTS \"\${_bd}/liblibGLESv2_angle.dylib\")
133+
file(RENAME \"\${_bd}/liblibGLESv2_angle.dylib\" \"\${_bd}/libGLESv2.dylib\")
134+
execute_process(COMMAND install_name_tool -id @rpath/libGLESv2.dylib \"\${_bd}/libGLESv2.dylib\")
135+
endif()
136+
file(GLOB _dylibs \"\${_bd}/*.dylib\")
137+
foreach(_d IN LISTS _dylibs)
138+
execute_process(COMMAND install_name_tool -change @rpath/liblibEGL_angle.dylib @rpath/libEGL.dylib \"\${_d}\" ERROR_QUIET)
139+
execute_process(COMMAND install_name_tool -change @rpath/liblibGLESv2_angle.dylib @rpath/libGLESv2.dylib \"\${_d}\" ERROR_QUIET)
140+
endforeach()
141+
")
142+
122143
# ----- Bundle the PoB Lua tree -----
123144
if (EXISTS "${POB_LUA_TREE}/src/Launch.lua")
124145
install(DIRECTORY "${POB_LUA_TREE}/src"

0 commit comments

Comments
 (0)