Skip to content

Commit c12b88d

Browse files
committed
build: support static libclosure builds
While we are still undecided on the state of libclosure (whether it should be supported as a dynamic-only linked dependency or whether we should support statically linking against the library), tweak the build to support the static builds on Windows.
1 parent b4c9179 commit c12b88d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/BlocksRuntime/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ if(WIN32)
77
BlocksRuntime.def)
88

99
if(NOT BUILD_SHARED_LIBS)
10-
target_compile_definitions(BlocksRuntime PRIVATE
10+
target_compile_definitions(BlocksRuntime PUBLIC
1111
BlocksRuntime_STATIC)
12+
target_compile_options(BlocksRuntime PUBLIC
13+
"$<$<COMPILE_LANGUAGE:C,CXX>:SHELL:$<$<BOOL:${MSVC}>:-Xclang >-static-libclosure>"
14+
$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -static-libclosure>)
1215
endif()
1316
endif()
1417

0 commit comments

Comments
 (0)