Skip to content

Commit 1a391d7

Browse files
committed
build: correctly enable blocks for tests when using clang-cl
clang-cl does not support -fblocks, so prefix it with -Xclang to pass it directly to the frontend like src/CMakeLists.txt does.
1 parent 44f67b2 commit 1a391d7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ function(add_unit_test name)
8282
PRIVATE
8383
${BSD_OVERLAY_CFLAGS})
8484
endif()
85-
target_compile_options(${name} PRIVATE -fblocks)
85+
if("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")
86+
target_compile_options(${name} PRIVATE -Xclang -fblocks)
87+
else()
88+
target_compile_options(${name} PRIVATE -fblocks)
89+
endif()
8690
# TODO(compnerd) make this portable
8791
target_compile_options(${name} PRIVATE -Wall -Wno-deprecated-declarations)
8892
dispatch_set_linker(${name})

0 commit comments

Comments
 (0)