@@ -131,35 +131,31 @@ function(handle_gyb_sources dependency_out_var_name sources_var_name arch)
131
131
"${SWIFT_SOURCE_DIR} /utils/gyb_sourcekit_support/UIDs.py" )
132
132
133
133
foreach (src ${${sources_var_name} })
134
- string (REGEX REPLACE "[.]gyb$" "" src_sans_gyb "${src} " )
135
- if (src STREQUAL src_sans_gyb)
136
- list (APPEND de_gybbed_sources "${src} " )
134
+ # On Windows (using Visual Studio), the generated project files assume that the
135
+ # generated GYB files will be in the source, not binary directory.
136
+ # We can work around this by modifying the root directory when generating VS projects.
137
+ if ("${CMAKE_GENERATOR_PLATFORM} " MATCHES "Visual Studio" )
138
+ set (dir_root ${CMAKE_CURRENT_SOURCE_DIR} )
137
139
else ()
140
+ set (dir_root ${CMAKE_CURRENT_BINARY_DIR} )
141
+ endif ()
138
142
139
- # On Windows (using Visual Studio), the generated project files assume that the
140
- # generated GYB files will be in the source, not binary directory.
141
- # We can work around this by modifying the root directory when generating VS projects.
142
- if ("${CMAKE_GENERATOR_PLATFORM} " MATCHES "Visual Studio" )
143
- set (dir_root ${CMAKE_CURRENT_SOURCE_DIR} )
144
- else ()
145
- set (dir_root ${CMAKE_CURRENT_BINARY_DIR} )
146
- endif ()
147
-
148
- if (arch)
149
- set (dir "${dir_root} /${ptr_size} " )
150
- else ()
151
- set (dir "${dir_root} " )
152
- endif ()
153
- set (output_file_name "${dir} /${src_sans_gyb} " )
154
- list (APPEND de_gybbed_sources "${output_file_name} " )
155
- handle_gyb_source_single(dependency_target
156
- SOURCE "${src} "
157
- OUTPUT "${output_file_name} "
158
- FLAGS ${extra_gyb_flags}
159
- DEPENDS "${gyb_extra_sources} "
160
- COMMENT "with ptr size = ${ptr_size} " )
161
- list (APPEND dependency_targets "${dependency_target} " )
143
+ if (arch)
144
+ set (dir "${dir_root} /${ptr_size} " )
145
+ else ()
146
+ set (dir "${dir_root} " )
162
147
endif ()
148
+ # get_filename_component(src_sans_gyb ${src} NAME_WLE)
149
+ string (REGEX REPLACE "\. gyb$" "" src_sans_gyb ${src} )
150
+ set (output_file_name "${dir} /${src_sans_gyb} " )
151
+ list (APPEND de_gybbed_sources "${output_file_name} " )
152
+ handle_gyb_source_single(dependency_target
153
+ SOURCE "${src} "
154
+ OUTPUT "${output_file_name} "
155
+ FLAGS ${extra_gyb_flags}
156
+ DEPENDS "${gyb_extra_sources} "
157
+ COMMENT "with ptr size = ${ptr_size} " )
158
+ list (APPEND dependency_targets "${dependency_target} " )
163
159
endforeach ()
164
160
set ("${dependency_out_var_name} " "${dependency_targets} " PARENT_SCOPE)
165
161
set ("${sources_var_name} " "${de_gybbed_sources} " PARENT_SCOPE)
0 commit comments