diff --git a/CMakeLists.txt b/CMakeLists.txt index d2e0dfcc4e2..f5eaade650a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -627,14 +627,6 @@ else() ${BIN_SOURCES}) endif() -if(CMAKE_STRIP AND NOT DISABLE_STRIP) - add_custom_command( - TARGET ${BIN_TARGET} POST_BUILD - DEPENDS ${BIN_TARGET} - COMMAND $<$,$>:${CMAKE_STRIP}> - ARGS $) -endif() - if(USE_PATCH) set(DEVIL_PATCHER devil_patcher) set(devil_patcher_SRCS @@ -756,6 +748,22 @@ if(USE_PATCH) ${CMAKE_BINARY_DIR}) endif() +if(CMAKE_STRIP AND NOT DISABLE_STRIP) + add_custom_command( + TARGET ${BIN_TARGET} POST_BUILD + DEPENDS ${BIN_TARGET} + COMMAND $<$,$>:${CMAKE_STRIP}> + ARGS $) + + if(USE_PATCH) + add_custom_command( + TARGET ${DEVIL_PATCHER} POST_BUILD + DEPENDS ${DEVIL_PATCHER} + COMMAND $<$,$>:${CMAKE_STRIP}> + ARGS $) + endif() +endif() + # Use file GENERATE instead of configure_file because configure_file # does not support generator expressions. get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)