Skip to content

Commit 8076e44

Browse files
committed
Use file write instead of echo when generating the Podfile
On some versions of Mac, echo does not support -e, leading to malformed Podfiles. Switch to use file write instead. From testing, it only regenerates the file if the CMakeLists changes, which is desired. PiperOrigin-RevId: 246597608
1 parent a468d15 commit 8076e44

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

cmake/download_pod_headers.cmake

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,15 @@ function(setup_pod_headers_target TARGET_NAME POD_DIR POD_LIST)
3333
set(pod_lines "")
3434
foreach(pod ${POD_LIST})
3535
string(CONCAT pod_lines "${pod_lines}"
36-
" pod ${pod}\\n")
36+
" pod ${pod}\n")
3737
endforeach(pod)
3838
string(CONCAT podfile_contents
39-
"source 'https://github.com/CocoaPods/Specs.git'\\n"
40-
"platform :ios, '8.0'\\n"
41-
"target 'GetPods' do\\n"
39+
"source 'https://github.com/CocoaPods/Specs.git'\n"
40+
"platform :ios, '8.0'\n"
41+
"target 'GetPods' do\n"
4242
"${pod_lines}"
4343
"end")
44-
add_custom_command(
45-
OUTPUT ${podfile}
46-
COMMAND echo -e "${podfile_contents}" > ${podfile}
47-
VERBATIM
48-
# Add a dependency on the CMakeLists file, so that any changes force a
49-
# rebuild of this process.
50-
DEPENDS ${CMAKE_CURRENT_LIST_FILE}
51-
)
44+
file(WRITE "${podfile}" "${podfile_contents}")
5245

5346
# Create the CMake file needed for the xcode project.
5447
# This can be done at configure time since the files will never change.

0 commit comments

Comments
 (0)