Skip to content

Commit e4751e4

Browse files
authored
Avoid expanding search path when generating cxx header
The ARG_SEARCH_PATHS variable is a list, just like SOURCES, and can be referenced directly in add_custom_command. Expanding the list manually by replacing ; with spaces would result in linker lines with `-I/foo\ -I/bar`.
1 parent c5f6cfa commit e4751e4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

3_bidirectional_cxx_interop/cmake/modules/AddSwift.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ function(_swift_generate_cxx_header_target target module header)
1717

1818
if(ARG_SEARCH_PATHS)
1919
list(TRANSFORM ARG_SEARCH_PATHS PREPEND "-I")
20-
string(REPLACE ";" " " EXPANDED_SEARCH_PATHS "${ARG_SEARCH_PATHS}")
2120
endif()
2221

2322
if(APPLE)
@@ -31,7 +30,7 @@ function(_swift_generate_cxx_header_target target module header)
3130
"${header}"
3231
COMMAND
3332
${CMAKE_Swift_COMPILER} -frontend -typecheck
34-
${EXPANDED_SEARCH_PATHS}
33+
${ARG_SEARCH_PATHS}
3534
${ARG_SOURCES}
3635
${SDK_FLAGS}
3736
-module-name "${module}"

0 commit comments

Comments
 (0)