diff options
| author | ruki <[email protected]> | 2022-11-15 22:54:27 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-11-15 22:54:27 +0800 |
| commit | f40cd6da49ed65067d4c6060fa3605cdbd994499 (patch) | |
| tree | 449bb0617d10022398d8823523e20d7eede664e1 | |
| parent | b5a4e93c9f12c9f9ce23c3c4c17b26c7960cbfc2 (diff) | |
clean msvc import library #3052
| -rw-r--r-- | xmake/modules/target/action/clean/main.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/xmake/modules/target/action/clean/main.lua b/xmake/modules/target/action/clean/main.lua index 74ebf39bb..8871ca21f 100644 --- a/xmake/modules/target/action/clean/main.lua +++ b/xmake/modules/target/action/clean/main.lua @@ -32,7 +32,19 @@ function main(target) end -- remove the target file - remove_files(target:targetfile()) + local targetfile = target:targetfile() + remove_files(targetfile) + + -- remove import library of the target file + -- @see https://github.com/xmake-io/xmake/issues/3052 + if target:is_plat("windows") and target:is_shared() then + local expfile = path.join(path.directory(targetfile), path.basename(targetfile) .. ".exp") + local libfile = path.join(path.directory(targetfile), path.basename(targetfile) .. ".lib") + if os.isfile(expfile) then + remove_files(libfile) + remove_files(expfile) + end + end -- remove the symbol file remove_files(target:symbolfile()) |
