diff --git a/cmake/LYWrappers.cmake b/cmake/LYWrappers.cmake index 53895c300f..8e5633b5e6 100644 --- a/cmake/LYWrappers.cmake +++ b/cmake/LYWrappers.cmake @@ -330,9 +330,12 @@ function(ly_add_target) set(runtime_dependencies_list SHARED MODULE EXECUTABLE APPLICATION) if(NOT ly_add_target_IMPORTED AND linking_options IN_LIST runtime_dependencies_list) + get_property(is_multi_config_generator GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) # XCode generator doesnt support different source files per configuration, so we cannot have # the runtime dependencies using file-tracking, instead, we will have them as a post build step - if(CMAKE_GENERATOR MATCHES Xcode) + # Non-multi config generators like Ninja (not "Ninja Multi-Config"), Makefiles, etc have trouble to + # produce file-level dependencies per configuration, so we also default to use a post build step + if(NOT is_multi_config_generator OR CMAKE_GENERATOR MATCHES Xcode) add_custom_command(TARGET ${ly_add_target_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/runtime_dependencies/$/${ly_add_target_NAME}.cmake