Skip to content

Commit

Permalink
Add $ORIGIN rpath by default (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
msz-rai authored and prybicki committed Mar 9, 2023
1 parent b750bf8 commit b7bc452
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def main():
parser.add_argument("--make", type=str, default=f"-j{os.cpu_count()}", dest="build_args",
help="Pass arguments to make. Usage: --make=\"args...\". Defaults to \"-j <cpu count>\"")
parser.add_argument("--lib-rpath", type=str, nargs='*',
help="Add run-time search path(s) for RGL library")
help="Add run-time search path(s) for RGL library. $ORIGIN (actual library path) is added by default.")
if on_windows():
parser.add_argument("--ninja", type=str, default=f"-j{os.cpu_count()}", dest="build_args",
help="Pass arguments to ninja. Usage: --ninja=\"args...\". Defaults to \"-j <cpu count>\"")
Expand Down Expand Up @@ -122,12 +122,12 @@ def is_cuda_version_ok():

if on_linux():
# Set rpaths
linker_rpath_flags = ["-Wl,-rpath=\\$ORIGIN"] # add directory in which an RGL library is located
if args.lib_rpath is not None:
linker_rpath_flags = []
for rpath in args.lib_rpath:
rpath = rpath.replace("$ORIGIN", "\\$ORIGIN") # cmake should not treat this as variable
linker_rpath_flags.append(f"-Wl,-rpath={rpath}")
cmake_args.append(f"-DCMAKE_SHARED_LINKER_FLAGS=\"{' '.join(linker_rpath_flags)}\"")
cmake_args.append(f"-DCMAKE_SHARED_LINKER_FLAGS=\"{' '.join(linker_rpath_flags)}\"")

if on_windows():
cmake_args.append("-DRGL_BUILD_TOOLS=OFF") # Tools are not available on Windows
Expand Down

0 comments on commit b7bc452

Please sign in to comment.