Ver código fonte

cmake: Fix copy to rundir in Release and MinSizeRel configurations

Generated post build action batch scripts retained an empty token to
the copy command with the used generator expression (as PDBs are only
generated for Debug and RelWithDebInfo configurations).

Moving their copy step into its own command (and using the `true`
CMake command, which is a no-op) ensures that builds in Release and
MinSizeRel correctly finish this step.
PatTheMav 2 anos atrás
pai
commit
61bed7a828
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2 1
      cmake/windows/helpers.cmake

+ 2 - 1
cmake/windows/helpers.cmake

@@ -228,7 +228,8 @@ function(_target_install_obs target)
     TARGET ${target}
     POST_BUILD
     COMMAND "${CMAKE_COMMAND}" -E make_directory "${OBS_OUTPUT_DIR}/$<CONFIG>/${_TIO_DESTINATION}"
-    COMMAND "${CMAKE_COMMAND}" -E copy ${target_file} "$<$<CONFIG:Debug,RelWithDebInfo>:${target_pdb_file}>"
+    COMMAND "${CMAKE_COMMAND}" -E copy ${target_file} "${OBS_OUTPUT_DIR}/$<CONFIG>/${_TIO_DESTINATION}"
+    COMMAND "${CMAKE_COMMAND}" -E $<IF:$<CONFIG:Debug,RelWithDebInfo>,copy,true> ${target_pdb_file}
             "${OBS_OUTPUT_DIR}/$<CONFIG>/${_TIO_DESTINATION}"
     COMMENT "${comment}"
     VERBATIM)