From cddbe4642fb4cc1f9bf705636e0e18030dfe1d38 Mon Sep 17 00:00:00 2001 From: Martin Stadler Date: Thu, 12 May 2022 03:33:05 +0200 Subject: [PATCH] Fix cmake rules to support higher-level targest (#3377) (#3386). Don't add linker flags as generator expression to support linking `TARGET` to higher-level targets in a top-level CMakeLists.txt file. --- docs/CONTRIBUTORS | 1 + verilator-config.cmake.in | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/CONTRIBUTORS b/docs/CONTRIBUTORS index d4dd640f7..8079639e2 100644 --- a/docs/CONTRIBUTORS +++ b/docs/CONTRIBUTORS @@ -71,6 +71,7 @@ Markus Krause Marlon James Marshal Qiao Martin Schmidt +Martin Stadler Matthew Ballance Michael Killough Michaƫl Lefebvre diff --git a/verilator-config.cmake.in b/verilator-config.cmake.in index f408721c4..7573d29ae 100644 --- a/verilator-config.cmake.in +++ b/verilator-config.cmake.in @@ -334,9 +334,14 @@ function(verilate TARGET) target_link_libraries(${TARGET} PUBLIC ${${VERILATE_PREFIX}_USER_LDLIBS} - "$<$>:${VERILATOR_MT_CFLAGS}>" ) + if (${VERILATE_PREFIX}_THREADS OR ${VERILATE_PREFIX}_TRACE_THREADS) + target_link_libraries(${TARGET} PUBLIC + ${VERILATOR_MT_CFLAGS} + ) + endif() + target_compile_features(${TARGET} PRIVATE cxx_std_11) endfunction()