diff options
| author | ruki <[email protected]> | 2021-08-21 00:46:07 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-08-21 00:46:07 +0800 |
| commit | a226ce07d85f3aab66b6dacf6f91e85f7296a490 (patch) | |
| tree | 7aead5aa3cccab016e06175eddf040fb40b7de89 /xmake/modules/target | |
| parent | c95fdc3f443b3dee83708b42bc34383a47601e13 (diff) | |
improve to copy symlink for installation
Diffstat (limited to 'xmake/modules/target')
| -rw-r--r-- | xmake/modules/target/action/install/unix.lua | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/xmake/modules/target/action/install/unix.lua b/xmake/modules/target/action/install/unix.lua index bd2a1cdb1..2f55dbd3b 100644 --- a/xmake/modules/target/action/install/unix.lua +++ b/xmake/modules/target/action/install/unix.lua @@ -43,7 +43,17 @@ function _install_shared_for_package(target, pkg, outputdir) if os.isfile(path.join(outputdir, soname)) then wprint("'%s' already exists in install dir, overwriting it from package(%s).", soname, pkg:name()) end - os.vcp(sopath, outputdir) + -- we need reserve symlink + -- @see https://github.com/xmake-io/xmake/issues/1582 + os.vcp(sopath, outputdir, {symlink = true}) + -- copy real file of symlink + if os.islink(sopath) then + local realpath = os.readlink(sopath) + if not path.is_absolute(realpath) then + realpath = path.absolute(realpath, path.directory(sopath)) + end + os.vcp(realpath, outputdir) + end end end end |
