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.
This commit is contained in:
Martin Stadler 2022-05-12 03:33:05 +02:00 committed by GitHub
parent bdfdc737a0
commit cddbe4642f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -71,6 +71,7 @@ Markus Krause
Marlon James
Marshal Qiao
Martin Schmidt
Martin Stadler
Matthew Ballance
Michael Killough
Michaël Lefebvre

View File

@ -334,9 +334,14 @@ function(verilate TARGET)
target_link_libraries(${TARGET} PUBLIC
${${VERILATE_PREFIX}_USER_LDLIBS}
"$<$<BOOL:$<TARGET_PROPERTY:VERILATOR_THREADED>>:${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()