|
41 | 41 | # A consumer using these variables has to set it, because a compiler defaulting |
42 | 42 | # to an older standard cannot parse them. |
43 | 43 | # |
| 44 | +# EXECUTORCH_RUNTIME_LIBRARY_DIR -- Where the shipped libraries live. A consumer |
| 45 | +# that installs its own binary elsewhere adds this to its INSTALL_RPATH, because |
| 46 | +# CMake removes the entry it recorded while building. |
| 47 | +# |
44 | 48 | # EXECUTORCH_LIBRARIES -- Libraries to link against: the prebuilt runtime and |
45 | 49 | # the components the wheel shipped, except the ones documented below as opt in. |
46 | 50 | # Not the Python extension, which carries unresolved interpreter symbols that |
@@ -184,6 +188,16 @@ if(EXISTS "${_executorch_version_file}") |
184 | 188 | endif() |
185 | 189 | unset(_executorch_version_file) |
186 | 190 |
|
| 191 | +# Where the shipped libraries live. Computed here rather than beside the Python |
| 192 | +# extension, because a consumer on the older variables route is told to put this |
| 193 | +# in its INSTALL_RPATH, and a package built without that extension would |
| 194 | +# otherwise hand it an empty string and produce a binary that cannot start. |
| 195 | +if(_executorch_runtime_library) |
| 196 | + get_filename_component( |
| 197 | + EXECUTORCH_RUNTIME_LIBRARY_DIR "${_executorch_runtime_library}" DIRECTORY |
| 198 | + ) |
| 199 | +endif() |
| 200 | + |
187 | 201 | set(EXECUTORCH_INCLUDE_DIRS "${_executorch_package_root}/include" |
188 | 202 | "${_executorch_c10_include}" |
189 | 203 | ) |
@@ -746,12 +760,6 @@ if(_portable_lib_LIBRARY) |
746 | 760 | # every consumer and survives install, which would bake this machine's |
747 | 761 | # package location into a library the consumer ships onward. A consumer that |
748 | 762 | # installs elsewhere adds these to its own INSTALL_RPATH. |
749 | | - get_filename_component( |
750 | | - EXECUTORCH_RUNTIME_LIBRARY_DIR "${_executorch_runtime_library}" DIRECTORY |
751 | | - ) |
752 | | - get_filename_component( |
753 | | - EXECUTORCH_PYTHON_EXTENSION_DIR "${_portable_lib_LIBRARY}" DIRECTORY |
754 | | - ) |
755 | 763 | endif() |
756 | 764 | endif() |
757 | 765 |
|
|
0 commit comments