From 80b291407b523339f09cf3898df7974b48016962 Mon Sep 17 00:00:00 2001 From: Yoda Lee Date: Fri, 3 Feb 2023 11:08:13 +0800 Subject: [PATCH] Add cmake warning if multiple SOURCES w/o PREFIX (#3916) (#3927) --- verilator-config.cmake.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/verilator-config.cmake.in b/verilator-config.cmake.in index 6b2338662..5abcc1711 100644 --- a/verilator-config.cmake.in +++ b/verilator-config.cmake.in @@ -142,6 +142,10 @@ function(verilate TARGET) endif() if (NOT VERILATE_PREFIX) + list(LENGTH VERILATE_SOURCES NUM_SOURCES) + if (${NUM_SOURCES} GREATER 1) + message(WARNING "Specify PREFIX if there are multiple SOURCES") + endif() list(GET VERILATE_SOURCES 0 TOPSRC) get_filename_component(_SRC_NAME ${TOPSRC} NAME_WE) set(VERILATE_PREFIX V${_SRC_NAME})