From f74814a34d299ec57aab09b40f333e77db104b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Risto=20Peja=C5=A1inovi=C4=87?= Date: Thu, 9 Jan 2025 13:23:54 +0100 Subject: [PATCH] Xcelium, do not create elaboration target if already exists --- cmake/sim/cadence/xcelium.cmake | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/cmake/sim/cadence/xcelium.cmake b/cmake/sim/cadence/xcelium.cmake index 9d387cd..ae5613c 100644 --- a/cmake/sim/cadence/xcelium.cmake +++ b/cmake/sim/cadence/xcelium.cmake @@ -84,26 +84,26 @@ function(xcelium IP_LIB) ${OUTDIR}/xcelium.d ) - set(DESCRIPTION "Compile testbench ${IP_LIB} with ${CMAKE_CURRENT_FUNCTION} xmelab") - set(STAMP_FILE "${BINARY_DIR}/${IP_LIB}_${CMAKE_CURRENT_FUNCTION}.stamp") - add_custom_command( - # OUTPUT ${SIM_EXEC_PATH} ${STAMP_FILE} - OUTPUT ${STAMP_FILE} - COMMAND ${__xmelab_cmd} - COMMAND touch ${STAMP_FILE} - COMMENT ${DESCRIPTION} - BYPRODUCTS ${__clean_files} - WORKING_DIRECTORY ${OUTDIR} - DEPENDS ${__comp_tgts} ${SOURCES} - COMMAND_EXPAND_LISTS - ) - - add_custom_target(${IP_LIB}_xcelium - DEPENDS ${STAMP_FILE} ${IP_LIB} - ) - set_property(TARGET ${IP_LIB}_xcelium PROPERTY DESCRIPTION ${DESCRIPTION}) - + if(NOT TARGET ${IP_LIB}_xcelium) + set(DESCRIPTION "Compile testbench ${IP_LIB} with ${CMAKE_CURRENT_FUNCTION} xmelab") + set(STAMP_FILE "${BINARY_DIR}/${IP_LIB}_${CMAKE_CURRENT_FUNCTION}.stamp") + add_custom_command( + # OUTPUT ${SIM_EXEC_PATH} ${STAMP_FILE} + OUTPUT ${STAMP_FILE} + COMMAND ${__xmelab_cmd} + COMMAND touch ${STAMP_FILE} + COMMENT ${DESCRIPTION} + BYPRODUCTS ${__clean_files} + WORKING_DIRECTORY ${OUTDIR} + DEPENDS ${__comp_tgts} ${SOURCES} + COMMAND_EXPAND_LISTS + ) + add_custom_target(${IP_LIB}_xcelium + DEPENDS ${STAMP_FILE} ${IP_LIB} + ) + set_property(TARGET ${IP_LIB}_xcelium PROPERTY DESCRIPTION ${DESCRIPTION}) + endif() ## XMSIM command for running simulation