summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-01-23 07:06:57 +0800
committerGitHub <[email protected]>2022-01-23 07:06:57 +0800
commit335c29ab1f40b8db81dce90388d846bdb0682e10 (patch)
tree3a6cfbce027b16a84cf13410be506fa9c8183cdf
parentfbb71638f89fb2450aaffdc424d3c8354eff3455 (diff)
parent10a2694a516ddf2441bb1ea0d46e0738a631d541 (diff)
Merge pull request #1999 from SirLynix/patch-9
package/cmake: copy pdb files to install dir
-rw-r--r--xmake/modules/package/tools/cmake.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 4e2662604..73f53425b 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -280,6 +280,9 @@ function _get_configs_for_windows(package, configs, opt)
table.insert(configs, '-DCMAKE_C_FLAGS_DEBUG=/' .. vs_runtime .. ' ' .. default_debug_flags)
table.insert(configs, '-DCMAKE_C_FLAGS_RELEASE=/' .. vs_runtime .. ' ' .. default_release_flags)
end
+ if not opt._configs_str:find("CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY") then
+ table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=pdb")
+ end
_get_configs_for_generic(package, configs, opt)
end
@@ -626,6 +629,11 @@ function _install_for_msvc(package, configs, opt)
os.trycp("**.dll", package:installdir("bin"))
os.trycp("**.lib", package:installdir("lib"))
os.trycp("**.exp", package:installdir("lib"))
+ if package:config("shared") or not package:is_library() then
+ os.trycp("**.pdb", package:installdir("bin"))
+ else
+ os.trycp("**.pdb", package:installdir("lib"))
+ end
end
end
@@ -789,5 +797,12 @@ function install(package, configs, opt)
_install_for_make(package, configs, opt)
end
end
+ if package:is_plat("windows") and os.isdir("pdb") then
+ if package:config("shared") or not package:is_library() then
+ os.trycp("pdb/**.pdb", package:installdir("bin"))
+ else
+ os.trycp("pdb/**.pdb", package:installdir("lib"))
+ end
+ end
os.cd(oldir)
end