File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1501,11 +1501,15 @@ function(configure_lit_site_cfg site_in site_out)
1501
1501
get_filename_component (OUTPUT_DIR ${site_out} DIRECTORY )
1502
1502
execute_process (COMMAND "${PYTHON_EXECUTABLE} " "-c" "\n
1503
1503
import os, sys\n
1504
- drive = os.path.splitdrive(sys.argv[1])[0]\n
1504
+ base = sys.argv[1]
1505
+ def haslink(p):\n
1506
+ if not p or p == os.path.dirname(p): return False\n
1507
+ return os.path.islink(p) or haslink(os.path.dirname(p))\n
1505
1508
def relpath(p):\n
1506
1509
if not p: return ''\n
1507
- if os.path.splitdrive(p)[0] != drive: return p\n
1508
- return os.path.relpath(p, sys.argv[1]).replace(os.sep, '/')\n
1510
+ if os.path.splitdrive(p)[0] != os.path.splitdrive(base)[0]: return p\n
1511
+ if haslink(p) or haslink(base): return p\n
1512
+ return os.path.relpath(p, base).replace(os.sep, '/')\n
1509
1513
sys.stdout.write(';'.join(relpath(p) for p in sys.argv[2].split(';')))"
1510
1514
${OUTPUT_DIR}
1511
1515
${ARG_PATH_VALUES_ESCAPED}
You can’t perform that action at this time.
0 commit comments