Fix CMake compiler coroutine flags (#7404)

This commit is contained in:
Shogo Yamazaki
2026-04-10 19:20:54 -04:00
committed by GitHub
parent 89c93980f3
commit b886367128
2 changed files with 10 additions and 8 deletions
+1
View File
@@ -239,6 +239,7 @@ Sebastien Van Cauwenberghe
Sergey Fedorov
Sergi Granell
Seth Pellegrino
Shogo Yamazaki
Shou-Li Hsu
Srinivasan Venkataramanan
Stefan Wallentowitz
+9 -8
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()