Fixes Ninja non-multi config generator and potentially other non-multi config generators (#3867)

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-09-02 08:56:29 -07:00
committed by GitHub
parent 34dc8e3cbc
commit 188f54fee0
+4 -1
View File
@@ -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/$<CONFIG>/${ly_add_target_NAME}.cmake