diff options
| -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 |
