-
Notifications
You must be signed in to change notification settings - Fork 0
Fix RPATH on linux to point in bin dir #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
5ff1792
e62a449
818d7a8
a910c76
851137a
dda1ee4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,18 +43,27 @@ string(COMPARE EQUAL "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}" _HVT_PR | |
|
|
||
| # Variables that need to be set prior to the project definition. | ||
| if (_HVT_PROJECT_IS_TOP_LEVEL AND UNIX) | ||
| # Set platform-specific RPATH syntax | ||
| if (APPLE) | ||
| set(_rpath "@loader_path/;@loader_path/../lib/") | ||
| set_if_not_defined(CMAKE_OSX_DEPLOYMENT_TARGET "12.0" "Minimum OSX deployment version") | ||
| set_if_not_defined(CMAKE_MACOSX_RPATH ON "") | ||
|
|
||
| # macOS specific validation | ||
DDoS marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| list(LENGTH CMAKE_OSX_ARCHITECTURES osx_arch_count) | ||
| if(osx_arch_count GREATER 1) | ||
| message(FATAL_ERROR "Universal builds are not supported because of libjpeg-turbo") | ||
| endif() | ||
| else() | ||
| # Linux | ||
| set(_rpath "$ORIGIN:$ORIGIN/../lib") | ||
| endif() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 No, The
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: Here is the file the code doesn't know yet where are the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This RPATH is relative to the loader (an executable in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Agree e.g.,
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CMake is supposed to set RPATHs automatically according to the linker command line. We shouldn't need an RPATH for the build.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All the USD lib and binaries are in lib and bin folders, we do not use the externals folder for that. It is the same with HVTEx. This also make sense, you can copy these folders and you have everything you need.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Nope.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Based on my experiments on macOS, the two must be explicit.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've never had to explicitly set the RPATH, as long as you leave the default CMake RPATH settings on. |
||
|
|
||
| # Common RPATH settings for all UNIX platforms | ||
| set_if_not_defined(CMAKE_SKIP_BUILD_RPATH TRUE "") | ||
| set_if_not_defined(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE "") | ||
| set_if_not_defined(CMAKE_INSTALL_RPATH "@loader_path/" "") | ||
| set_if_not_defined(CMAKE_INSTALL_RPATH "${_rpath}" "") | ||
| set_if_not_defined(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE "") | ||
|
|
||
| # macOS specific (ignored on other platforms) | ||
| list(LENGTH CMAKE_OSX_ARCHITECTURES osx_arch_count) | ||
| if(osx_arch_count GREATER 1) | ||
| message(FATAL_ERROR "Universal builds are not supported because of libjpeg-turbo") | ||
| endif() | ||
| set_if_not_defined(CMAKE_OSX_DEPLOYMENT_TARGET "12.0" "Minimum OSX deployment version") | ||
| set_if_not_defined(CMAKE_MACOSX_RPATH ON "") | ||
| endif() | ||
|
|
||
| # Enable only the typical build types. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.