Skip to content

Commit 0b37204

Browse files
committed
build: correct linking to static libdispatch on Windows
When building against the static libdispatch, we need to inform the dispatch headers that the library will be linked statically via `-Ddispatch_STATIC`. Wire this up onto the dispatch library to allow `swiftDispatch` to properly propagate that flag.
1 parent 6864757 commit 0b37204

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ target_include_directories(dispatch PRIVATE
9595
if(NOT BUILD_SHARED_LIBS)
9696
target_compile_definitions(dispatch PUBLIC
9797
dispatch_STATIC)
98+
target_compile_options(dispatch PUBLIC
99+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -Ddispatch_STATIC>")
98100
endif()
99101
if(WIN32)
100102
target_compile_definitions(dispatch PRIVATE

0 commit comments

Comments
 (0)