Skip to content

Commit 93c64d8

Browse files
authored
Merge pull request #365 from adierking/blocks
build: correctly enable blocks for tests when using clang-cl
2 parents 65ebc0c + 1a391d7 commit 93c64d8

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)