File tree Expand file tree Collapse file tree 4 files changed +23
-19
lines changed
stdlib/public/Observation/Sources/Observation Expand file tree Collapse file tree 4 files changed +23
-19
lines changed Original file line number Diff line number Diff line change @@ -83,16 +83,26 @@ if (SWIFT_SWIFT_PARSER)
83
83
list (TRANSFORM SWIFT_SYNTAX_MODULES APPEND ".swiftmodule"
84
84
OUTPUT_VARIABLE SWIFT_SYNTAX_MODULE_DIRS )
85
85
foreach (module_dir ${SWIFT_SYNTAX_MODULE_DIRS} )
86
+ # Find all of the source module files.
86
87
file (GLOB module_files
87
88
"${SWIFT_SYNTAX_LIBRARIES_SOURCE_DIR} /${module_dir} /*.swiftinterface" )
89
+
90
+ # Determine the destination module files.
91
+ set (dest_module_files )
92
+ foreach (full_module_file ${module_files} )
93
+ get_filename_component (module_file ${full_module_file} NAME )
94
+ list (APPEND dest_module_files
95
+ "${SWIFT_HOST_LIBRARIES_DEST_DIR} /${module_dir} /${module_file} " )
96
+ endforeach ()
97
+
88
98
add_custom_command (
89
- OUTPUT ${module_files }
99
+ OUTPUT ${dest_module_files }
90
100
COMMAND ${CMAKE_COMMAND} -E make_directory ${SWIFT_HOST_LIBRARIES_DEST_DIR} /${module_dir}
91
101
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${module_files} ${SWIFT_HOST_LIBRARIES_DEST_DIR} /${module_dir}/
92
102
COMMENT "Copying ${module_dir} "
93
103
)
94
104
95
- list (APPEND SWIFT_SYNTAX_DEST_FILES ${module_files } )
105
+ list (APPEND SWIFT_SYNTAX_DEST_FILES ${dest_module_files } )
96
106
endforeach ()
97
107
98
108
# Add a custom target to copy over the SwiftSyntax build products into
Original file line number Diff line number Diff line change @@ -45,6 +45,9 @@ function(add_swift_macro_library name)
45
45
ARCHIVE
46
46
DESTINATION "${SWIFT_HOST_PLUGINS_DEST_DIR} "
47
47
COMPONENT compiler )
48
+
49
+ # Export this macro plugin target.
50
+ set_property (GLOBAL APPEND PROPERTY SWIFT_MACRO_PLUGINS ${name} )
48
51
endfunction ()
49
52
50
53
add_subdirectory (Sources /ObservationMacros )
Original file line number Diff line number Diff line change 10
10
#
11
11
#===----------------------------------------------------------------------===#
12
12
13
- # Linux and windows hosts are disabled for now; it is dependent upon earlyswiftsyntax
14
- # which does not build in the same way just yet
15
- if (${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS )
13
+ # We can only build when earlyswiftsyntax is enabled.
14
+ if (SWIFT_SWIFT_PARSER )
16
15
list (APPEND swift_runtime_library_compile_flags -I${SWIFT_SOURCE_DIR}/stdlib/include -I${SWIFT_SOURCE_DIR}/include )
17
16
18
- set (SWIFT_OBSERVATION_SWIFT_FLAGS )
19
- set (SWIFT_OBSERVATION_DEPENDS )
20
-
21
- list (APPEND SWIFT_OBSERVATION_SWIFT_FLAGS
22
- "-enable-experimental-feature" "Macros"
23
- "-DSWIFT_OBSERVATION_MACROS"
24
- )
25
- list (APPEND SWIFT_OBSERVATION_DEPENDS ObservationMacros )
26
-
27
17
add_swift_target_library (swiftObservation ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
28
18
Locking.cpp
29
19
Locking.swift
@@ -37,15 +27,11 @@ if (${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS)
37
27
ThreadLocal.swift
38
28
TrackedProperties.swift
39
29
40
- DEPENDS ${SWIFT_OBSERVATION_DEPENDS}
41
-
42
30
SWIFT_COMPILE_FLAGS
43
31
${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
44
- ${SWIFT_OBSERVATION_SWIFT_FLAGS}
45
32
SWIFT_MODULE_DEPENDS _Concurrency
46
33
INSTALL_IN_COMPONENT stdlib
47
34
48
35
MACCATALYST_BUILD_FLAVOR "zippered"
49
36
)
50
-
51
- endif ()
37
+ endif ()
Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ function(add_swift_parser_link_libraries target)
7
7
if (SWIFT_SWIFT_PARSER )
8
8
target_link_libraries (${target}
9
9
PRIVATE swiftCore )
10
+
11
+ get_property (SWIFT_MACRO_PLUGINS GLOBAL PROPERTY SWIFT_MACRO_PLUGINS )
12
+ foreach (macrolib ${SWIFT_MACRO_PLUGINS} )
13
+ add_dependencies (${target} ${macrolib} )
14
+ endforeach ()
10
15
endif ()
11
16
endfunction ()
12
17
You can’t perform that action at this time.
0 commit comments