cmake: Skip PDB install for interface target

This commit is contained in:
tytan652 2024-01-13 16:16:19 +01:00 • committed by Matthew Gajownik
commit 7c2b39436b
2 changed files with 11 additions and 7 deletions

View file

@ -234,7 +234,8 @@ function(export_target target)
COMPONENT obs_libraries
EXCLUDE_FROM_ALL)
if(MSVC)
get_target_property(target_type ${target} TYPE)
if(MSVC AND NOT target_type STREQUAL INTERFACE_LIBRARY)
install(
FILES $<TARGET_PDB_FILE:${target}>
CONFIGURATIONS "RelWithDebInfo" "Debug"

View file

@ -274,12 +274,15 @@ function(target_export target)
set(exclude_variant EXCLUDE_FROM_ALL)
_target_export(${target})
install(
FILES "$<TARGET_PDB_FILE:${target}>"
CONFIGURATIONS RelWithDebInfo Debug Release
DESTINATION "${OBS_EXECUTABLE_DESTINATION}"
COMPONENT Development
OPTIONAL)
get_target_property(target_type ${target} TYPE)
if(NOT target_type STREQUAL INTERFACE_LIBRARY)
install(
FILES "$<TARGET_PDB_FILE:${target}>"
CONFIGURATIONS RelWithDebInfo Debug Release
DESTINATION "${OBS_EXECUTABLE_DESTINATION}"
COMPONENT Development
OPTIONAL)
endif()
endfunction()
# Helper function to add resources into bundle