Skip to content

Commit cc35f9c

Browse files
committed
build: correct the resource layout for Windows
Windows uses the NeXT-ish layout with a different resource dir (`<TARGET>.resources`) rather than `Resources`. Account for that in the build.
1 parent a132f6e commit cc35f9c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: cmake/modules/SwiftSupport.cmake

+7-2
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ function(add_swift_target target)
177177
endif()
178178

179179
if(AST_RESOURCES)
180+
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
181+
set(resources_dir ${target}.resources)
182+
else()
183+
set(resources_dir Resources)
184+
endif()
180185
add_custom_command(TARGET
181186
${target}
182187
POST_BUILD
@@ -185,13 +190,13 @@ function(add_swift_target target)
185190
COMMAND
186191
${CMAKE_COMMAND} -E copy ${AST_OUTPUT} ${CMAKE_CURRENT_BINARY_DIR}/${target}
187192
COMMAND
188-
${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${target}/Resources)
193+
${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${target}/${resources_dir})
189194
foreach(resource ${AST_RESOURCES})
190195
add_custom_command(TARGET
191196
${target}
192197
POST_BUILD
193198
COMMAND
194-
${CMAKE_COMMAND} -E copy ${resource} ${CMAKE_CURRENT_BINARY_DIR}/${target}/Resources/)
199+
${CMAKE_COMMAND} -E copy ${resource} ${CMAKE_CURRENT_BINARY_DIR}/${target}/${resources_dir}/)
195200
endforeach()
196201
else()
197202
add_custom_command(TARGET

0 commit comments

Comments
 (0)