Fix CMake compiler coroutine flags (#7404)

This commit is contained in:
Shogo Yamazaki 2026-04-11 08:20:54 +09:00 committed by GitHub
parent 89c93980f3
commit b886367128
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 8 deletions

View File

@ -239,6 +239,7 @@ Sebastien Van Cauwenberghe
Sergey Fedorov
Sergi Granell
Seth Pellegrino
Shogo Yamazaki
Shou-Li Hsu
Srinivasan Venkataramanan
Stefan Wallentowitz

View File

@ -743,15 +743,16 @@ function(verilate TARGET)
target_link_libraries(${TARGET} PUBLIC ${VERILATOR_MT_CFLAGS})
target_compile_features(${TARGET} PRIVATE cxx_std_11)
if(${VERILATE_PREFIX}_TIMING)
check_cxx_compiler_flag(-fcoroutines-ts COROUTINES_TS_FLAG)
target_compile_options(
${TARGET}
PRIVATE
$<IF:$<BOOL:${COROUTINES_TS_FLAG}>,-fcoroutines-ts,-fcoroutines>
)
if("@CFG_CXXFLAGS_COROUTINES@" STREQUAL "-std=gnu++20")
target_compile_features(${TARGET} PRIVATE cxx_std_20)
else()
target_compile_options(
${TARGET}
PRIVATE
@CFG_CXXFLAGS_COROUTINES@
)
endif()
endif()
endfunction()