diff options
| author | SineStriker <[email protected]> | 2025-04-20 23:24:47 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-04-23 11:30:30 +0800 |
| commit | 93dda3ce130c3a71a3d8a7bb4776af6e82bcf1c5 (patch) | |
| tree | 492dfbb42f2c6d0f11e69624ee416ba7bf6e93ce /xmake/modules | |
| parent | 42be9d4228849def30a728b3933209a1cd90638e (diff) | |
Remove implib API
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/private/action/build/link_objects.lua | 10 | ||||
| -rw-r--r-- | xmake/modules/target/action/clean/main.lua | 8 | ||||
| -rw-r--r-- | xmake/modules/target/action/install/main.lua | 2 |
3 files changed, 14 insertions, 6 deletions
diff --git a/xmake/modules/private/action/build/link_objects.lua b/xmake/modules/private/action/build/link_objects.lua index 8d3c8e7a1..0ff51e17d 100644 --- a/xmake/modules/private/action/build/link_objects.lua +++ b/xmake/modules/private/action/build/link_objects.lua @@ -46,13 +46,19 @@ function _do_link_target(target, opt) local targetfile = target:targetfile() local objectfiles = target:objectfiles() local verbose = option.get("verbose") + + local target_implib = nil + if target:has_implib() then + target_implib = target:artifactfile("lib") + end + if verbose then -- show the full link command with raw arguments, it will expand @xxx.args for msvc/link on windows - print(linkinst:linkcmd(objectfiles, targetfile, {linkflags = linkflags, implib = target:implibfile(), rawargs = true})) + print(linkinst:linkcmd(objectfiles, targetfile, {linkflags = linkflags, implib = target_implib, rawargs = true})) end if not dryrun then - assert(linkinst:link(objectfiles, targetfile, {linkflags = linkflags, implib = target:implibfile()})) + assert(linkinst:link(objectfiles, targetfile, {linkflags = linkflags, implib = target_implib})) end end, {dependfile = target:dependfile(), lastmtime = os.mtime(target:targetfile()), diff --git a/xmake/modules/target/action/clean/main.lua b/xmake/modules/target/action/clean/main.lua index 8806ed483..b919c4d63 100644 --- a/xmake/modules/target/action/clean/main.lua +++ b/xmake/modules/target/action/clean/main.lua @@ -45,9 +45,11 @@ function main(target) end end - local implibfile = target:implibfile() - if implibfile and os.isfile(implibfile) then - remove_files(implibfile) + if target:has_implib() then + local libfile = target:artifactfile("lib") + if os.isfile(libfile) then + remove_files(libfile) + end end end diff --git a/xmake/modules/target/action/install/main.lua b/xmake/modules/target/action/install/main.lua index 660700c0b..321591ea2 100644 --- a/xmake/modules/target/action/install/main.lua +++ b/xmake/modules/target/action/install/main.lua @@ -237,7 +237,7 @@ function _install_shared(target, opt) -- @see https://github.com/xmake-io/xmake/issues/714 os.vcp(target:targetfile(), bindir) local libdir = _get_target_libdir(target, opt) - local target_implib = target:implibfile() + local target_implib = target:artifact("lib") if os.isfile(target_implib) then os.mkdir(libdir) os.vcp(target_implib, libdir) |
