diff options
| author | ruki <[email protected]> | 2018-09-29 20:32:59 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-09-29 20:32:59 +0800 |
| commit | 27294139797b23f90c3b46b860836f39a37d0e97 (patch) | |
| tree | 3d87129d4dc2c46d1dd476ebe04b425528255044 | |
| parent | 27658956cfe3f4223753059a3324a9b320320ad7 (diff) | |
link package file to prefix
| -rw-r--r-- | xmake/actions/require/action/install.lua | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/xmake/actions/require/action/install.lua b/xmake/actions/require/action/install.lua index ea60d9cd9..da7dde7c3 100644 --- a/xmake/actions/require/action/install.lua +++ b/xmake/actions/require/action/install.lua @@ -69,11 +69,20 @@ function install_prefix(package) -- scan all installed files local installfiles = {} - if package:kind() == "binary" then - table.join2(installfiles, (os.files(path.join(installdir, "**")))) + if is_host("windows") then + if package:kind() == "binary" then + table.join2(installfiles, (os.files(path.join(installdir, "**")))) + else + table.join2(installfiles, (os.files(path.join(package:installdir("lib"), "**")))) + table.join2(installfiles, (os.files(path.join(package:installdir("include"), "**")))) + end else - table.join2(installfiles, (os.files(path.join(package:installdir("lib"), "**")))) - table.join2(installfiles, (os.files(path.join(package:installdir("include"), "**")))) + if package:kind() == "binary" then + table.join2(installfiles, (os.filedirs(path.join(package:installdir("bin"), "*")))) + else + table.join2(installfiles, (os.filedirs(path.join(package:installdir("lib"), "*")))) + table.join2(installfiles, (os.filedirs(path.join(package:installdir("include"), "*")))) + end end -- trace @@ -92,8 +101,14 @@ function install_prefix(package) -- trace vprint("installing %s ..", relativefile) - -- copy file - os.cp(installfile, path.absolute(relativefile, prefixdir)) + -- install file + if is_host("windows") then + -- copy the whole file to the prefix directory + os.cp(installfile, path.absolute(relativefile, prefixdir)) + else + -- only link file to the prefix directory + os.ln(installfile, path.absolute(relativefile, prefixdir)) + end -- save this relative file table.insert(relativefiles, relativefile) |
