aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/common.cmake
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-10-28 20:57:35 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-10-28 20:57:50 +0300
commit9989c9f8f1fac87798160203b8e674cbc44f5ff6 (patch)
tree89119bc764255dc0eb7e102804321f255de9fefa /common.cmake
parentMakefile: check symbols for examples/boost also (diff)
downloadcmake-common-9989c9f8f1fac87798160203b8e674cbc44f5ff6.tar.gz
cmake-common-9989c9f8f1fac87798160203b8e674cbc44f5ff6.zip
common.cmake: add install_pdbs()before_toolchain_refactoring
Diffstat (limited to 'common.cmake')
-rw-r--r--common.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/common.cmake b/common.cmake
index c67f983..546db7d 100644
--- a/common.cmake
+++ b/common.cmake
@@ -222,3 +222,23 @@ if(NOT parent_dir)
_cc_apply_settings("${target}")
endmacro()
endif()
+
+function(install_pdbs)
+ if(NOT is_msvc)
+ return()
+ endif()
+ cmake_parse_arguments(INSTALL_PDBS "" "DESTINATION" "TARGETS" ${ARGN})
+ if(NOT INSTALL_PDBS_DESTINATION)
+ message(FATAL_ERROR "common.cmake: install_pdbs: please specify DESTINATION")
+ endif()
+ if(NOT INSTALL_PDBS_TARGETS)
+ message(FATAL_ERROR "common.cmake: install_pdbs: please specify TARGETS")
+ endif()
+ if(INSTALL_PDBS_UNPARSED_ARGUMENTS)
+ message(FATAL_ERROR "common.cmake: install_pdbs: unrecognized arguments: ${INSTALL_PDBS_UNPARSED_ARGUMENTS}")
+ endif()
+ foreach(target ${INSTALL_PDBS_TARGETS})
+ list(APPEND pdbs "$<TARGET_PDB_FILE:${target}>")
+ endforeach()
+ install(FILES ${pdbs} DESTINATION ${INSTALL_PDBS_DESTINATION} OPTIONAL)
+endfunction()