File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ if(NOT EXISTS "${SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE}")
6
6
return ()
7
7
endif ()
8
8
9
+ # Build swift-syntax libraries with FetchContent.
9
10
function (includeSwiftSyntax)
10
- # Build swift-syntax libraries with FetchContent.
11
11
set (CMAKE_Swift_COMPILER_TARGET ${SWIFT_HOST_TRIPLE} )
12
12
set (BUILD_SHARED_LIBS OFF )
13
13
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR} " )
@@ -31,15 +31,20 @@ set_target_properties(swiftSyntaxUnified PROPERTIES LINKER_LANGUAGE Swift)
31
31
32
32
macro (target_link_libraries_whole_archive target )
33
33
foreach (lib ${ARGN} )
34
+ force_add_dependencies(${target} ${lib} )
35
+
36
+ # Set auto linking name to the unified shared library name for each module.
34
37
target_compile_options (${lib} PRIVATE "SHELL:-module-link-name ${target} " )
38
+
39
+ # Link all the object file into one unified library.
35
40
target_sources (${target} PRIVATE $<TARGET_OBJECTS:${lib} >)
36
41
# Workaround for CMake doesn't recognize '.o' files as sources.
37
42
target_link_options (${target} PRIVATE $<TARGET_OBJECTS:${lib} >)
43
+
44
+ set_property (TARGET ${target} PROPERTY INTERFACE_INCLUDE_DIRECTORIES )
38
45
set_property (TARGET ${target} APPEND PROPERTY
39
46
INTERFACE_INCLUDE_DIRECTORIES "$<TARGET_PROPERTY:${lib} ,INTERFACE_INCLUDE_DIRECTORIES>"
40
47
)
41
- force_add_dependencies(${target} ${lib} )
42
-
43
48
endforeach ()
44
49
endmacro ()
45
50
You can’t perform that action at this time.
0 commit comments