1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-05 20:55:46 +03:00

cmake: Fix Ninja multiple rules error

Currently "cmake -G Ninja" complains about "multiple rules generate
src/libssh_dev.map", because the target has the same name as the output
of the custom command.

Signed-off-by: DDoSolitary <DDoSolitary@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
This commit is contained in:
DDoSolitary
2021-02-05 14:06:56 +08:00
committed by Jakub Jelen
parent 25f9ca83a4
commit 1a24b424ef

View File

@@ -469,12 +469,12 @@ function(generate_map_file _TARGET_NAME)
# a generated source # a generated source
add_custom_command( add_custom_command(
OUTPUT ${_MAP_OUTPUT_PATH} OUTPUT ${_MAP_OUTPUT_PATH}
DEPENDS ${_TARGET_NAME} DEPENDS ${_TARGET_NAME}_copy
) )
if (DEFINED _generate_map_file_COPY_TO) if (DEFINED _generate_map_file_COPY_TO)
# Copy the generated map back to the COPY_TO # Copy the generated map back to the COPY_TO
add_custom_target(${_TARGET_NAME} ALL add_custom_target(${_TARGET_NAME}_copy ALL
COMMAND COMMAND
${CMAKE_COMMAND} -E copy_if_different ${_MAP_OUTPUT_PATH} ${CMAKE_COMMAND} -E copy_if_different ${_MAP_OUTPUT_PATH}
${_generate_map_file_COPY_TO} ${_generate_map_file_COPY_TO}
@@ -483,7 +483,7 @@ function(generate_map_file _TARGET_NAME)
VERBATIM VERBATIM
) )
else() else()
add_custom_target(${_TARGET_NAME} ALL add_custom_target(${_TARGET_NAME}_copy ALL
DEPENDS ${_TARGET_NAME}_int DEPENDS ${_TARGET_NAME}_int
) )
endif() endif()