|
1 |
| - |
2 |
| -function(add_sourcekit_symbol_exports target_name export_file) |
3 |
| - # Makefile.rules contains special cases for different platforms. |
4 |
| - # We restrict ourselves to Darwin for the time being. |
5 |
| - if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") |
6 |
| - add_custom_command(OUTPUT symbol.exports |
7 |
| - COMMAND sed -e "s/^/_/" < ${export_file} > symbol.exports |
8 |
| - DEPENDS ${export_file} |
9 |
| - VERBATIM |
10 |
| - COMMENT "Creating export file for ${target_name}") |
11 |
| - add_custom_target(${target_name}_exports DEPENDS symbol.exports) |
12 |
| - set_property(DIRECTORY APPEND |
13 |
| - PROPERTY ADDITIONAL_MAKE_CLEAN_FILES symbol.exports) |
14 |
| - set_target_properties(${target_name}_exports PROPERTIES |
15 |
| - FOLDER "SourceKit libraries") |
16 |
| - |
17 |
| - get_property(srcs TARGET ${target_name} PROPERTY SOURCES) |
18 |
| - foreach(src ${srcs}) |
19 |
| - get_filename_component(extension ${src} EXT) |
20 |
| - if(extension STREQUAL ".cpp") |
21 |
| - set(first_source_file ${src}) |
22 |
| - break() |
23 |
| - endif() |
24 |
| - endforeach() |
25 |
| - |
26 |
| - # Force re-linking when the exports file changes. Actually, it |
27 |
| - # forces recompilation of the source file. The LINK_DEPENDS target |
28 |
| - # property only works for makefile-based generators. |
29 |
| - set_property(SOURCE ${first_source_file} APPEND PROPERTY |
30 |
| - OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/symbol.exports) |
31 |
| - |
32 |
| - set_property(TARGET ${target_name} APPEND_STRING PROPERTY |
33 |
| - LINK_FLAGS " -Wl,-exported_symbols_list,${CMAKE_CURRENT_BINARY_DIR}/symbol.exports") |
34 |
| - |
35 |
| - add_dependencies(${target_name} ${target_name}_exports) |
36 |
| - endif() |
37 |
| -endfunction() |
38 |
| - |
39 | 1 | # Add default compiler and linker flags to 'target'.
|
40 | 2 | #
|
41 | 3 | # FIXME: this is a HACK. All SourceKit CMake code using this function should be
|
@@ -155,7 +117,7 @@ macro(add_sourcekit_library name)
|
155 | 117 | swift_common_llvm_config(${name} ${SOURCEKITLIB_LLVM_LINK_COMPONENTS})
|
156 | 118 |
|
157 | 119 | if(SOURCEKITLIB_SHARED AND EXPORTED_SYMBOL_FILE)
|
158 |
| - add_sourcekit_symbol_exports(${name} ${EXPORTED_SYMBOL_FILE}) |
| 120 | + add_llvm_symbol_exports(${name} ${EXPORTED_SYMBOL_FILE}) |
159 | 121 | endif()
|
160 | 122 |
|
161 | 123 | if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
|
@@ -302,7 +264,7 @@ macro(add_sourcekit_framework name)
|
302 | 264 | swift_common_llvm_config(${name} ${SOURCEKITFW_LLVM_LINK_COMPONENTS})
|
303 | 265 |
|
304 | 266 | if (EXPORTED_SYMBOL_FILE)
|
305 |
| - add_sourcekit_symbol_exports(${name} ${EXPORTED_SYMBOL_FILE}) |
| 267 | + add_llvm_symbol_exports(${name} ${EXPORTED_SYMBOL_FILE}) |
306 | 268 | endif()
|
307 | 269 |
|
308 | 270 | if(SOURCEKITFW_MODULEMAP)
|
|
0 commit comments