Skip to content

Commit d7e2e1f

Browse files
committed
[SR-1613][SourceKit] Require blocks runtime
SourceKit makes heavy use of blocks. In order to port SourceKit to Linux, we either need to rewrite much of it to use function pointers, or we must require a blocks runtime. This commit requires a blocks runtime, but only when SourceKit is being built. Currently, SourceKit is not built on Linux, so this should not affect anyone.
1 parent 122350d commit d7e2e1f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ For OS X, you need [the latest Xcode](https://developer.apple.com/xcode/download
5858

5959
For Ubuntu, you'll need the following development dependencies:
6060

61-
sudo apt-get install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config
61+
sudo apt-get install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libblocksruntime-dev
6262

6363
**Note:** LLDB currently requires at least `swig-1.3.40` but will successfully build
6464
with version 2 shipped with Ubuntu.

tools/SourceKit/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ function(add_sourcekit_default_compiler_flags target)
8484
ANALYZE_CODE_COVERAGE "${analyze_code_coverage}"
8585
RESULT_VAR_NAME link_flags)
8686

87+
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
88+
list(APPEND c_compile_flags "-fblocks")
89+
list(APPEND link_flags "-lBlocksRuntime")
90+
endif()
91+
8792
# Convert variables to space-separated strings.
8893
_list_escape_for_shell("${c_compile_flags}" c_compile_flags)
8994
_list_escape_for_shell("${link_flags}" link_flags)

0 commit comments

Comments
 (0)