diff options
| author | Jérôme Leclercq <[email protected]> | 2022-01-22 22:30:13 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-22 22:30:13 +0100 |
| commit | 10a2694a516ddf2441bb1ea0d46e0738a631d541 (patch) | |
| tree | e78a7e9d794d0ff0175fe565f0374c24fa64ba47 /xmake/modules/package/tools/cmake.lua | |
| parent | e2bbeb1b0731b7720df562f7630c38c5da205126 (diff) | |
package/cmake: copy pdb files to install dir
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 15 |
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 |
