diff --git a/CMakeLists.txt b/CMakeLists.txt index 525fe1292..29143322a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -330,6 +330,9 @@ add_subdirectory(dispatch) add_subdirectory(man) add_subdirectory(os) add_subdirectory(private) +if(NOT APPLE) + add_subdirectory(src/BlocksRuntime) +endif() add_subdirectory(src) if(BUILD_TESTING) add_subdirectory(tests) diff --git a/src/BlocksRuntime/CMakeLists.txt b/src/BlocksRuntime/CMakeLists.txt index fc3d60252..4a06e1bfd 100644 --- a/src/BlocksRuntime/CMakeLists.txt +++ b/src/BlocksRuntime/CMakeLists.txt @@ -9,6 +9,9 @@ if(WIN32) if(NOT BUILD_SHARED_LIBS) target_compile_definitions(BlocksRuntime PRIVATE BlocksRuntime_STATIC) + target_compile_options(BlocksRuntime PUBLIC + "$<$:SHELL:$<$:-Xclang >-static-libclosure>" + $<$:SHELL:-Xcc -static-libclosure>) endif() endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a1f8a0c58..641f56be6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,9 +1,5 @@ -if(NOT APPLE) - add_subdirectory(BlocksRuntime) -endif() - -add_library(dispatch +add_library(dispatch SHARED allocator.c apply.c benchmark.c