Browse Source

cmake: Skip PDB install for interface target

tytan652 2 years ago
parent
commit
7c2b39436b
2 changed files with 11 additions and 7 deletions
  1. 2 1
      cmake/Modules/ObsHelpers_Windows.cmake
  2. 9 6
      cmake/windows/helpers.cmake

+ 2 - 1
cmake/Modules/ObsHelpers_Windows.cmake

@@ -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"

+ 9 - 6
cmake/windows/helpers.cmake

@@ -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