Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

[IndexStore] Enable blocks support on Linux builds #291

Open
wants to merge 1 commit into
base: upstream-with-swift
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tools/IndexStore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ if(APPLE)

set_property(TARGET IndexStore APPEND_STRING PROPERTY
LINK_FLAGS ${INDEXSTORE_LINK_FLAGS})
else()
# Blocks are off by default on non-darwin platforms.
target_compile_options(IndexStore PRIVATE -fblocks)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be hoisted out of the condition as it is safe to apply -fblocks when building for Darwin. However, please ensure that you do not apply this when the C++ compiler is not clang. The Windows builds use cl to build the toolchain as it is much faster and better.

target_link_libraries(IndexStore PRIVATE BlocksRuntime)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, this is really annoying. The BlocksRuntime really should come from libdispatch, as that is the canonical one that is used elsewhere in the swift project. I don't know how to break this cycle.

endif()

if (LLVM_INSTALL_TOOLCHAIN_ONLY)
Expand Down