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 Sergey Fedorov
Sergi Granell Sergi Granell
Seth Pellegrino Seth Pellegrino
Shogo Yamazaki
Shou-Li Hsu Shou-Li Hsu
Srinivasan Venkataramanan Srinivasan Venkataramanan
Stefan Wallentowitz Stefan Wallentowitz

View File

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