Skip to content

Commit 4d261df

Browse files
authored
Fail the cmake build if reading the version from the podspec fails (#8068)
1 parent edb839e commit 4d261df

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

cmake/podspec_rules.cmake

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ macro(podspec_version VARIABLE PODSPEC_FILE)
2323
OUTPUT_VARIABLE ${VARIABLE}
2424
OUTPUT_STRIP_TRAILING_WHITESPACE
2525
)
26+
if(${VARIABLE} STREQUAL "")
27+
message(
28+
FATAL_ERROR
29+
"Running the sed script ${PROJECT_SOURCE_DIR}/cmake/podspec_version.sed \
30+
on file ${PODSPEC_FILE} failed; ensure that the `sed` executable is \
31+
installed and that its directory is present in the PATH environment \
32+
variable."
33+
)
34+
endif()
2635
endmacro()
2736

2837
macro(firebase_version VARIABLE PODSPEC_FILE)
@@ -34,6 +43,15 @@ macro(firebase_version VARIABLE PODSPEC_FILE)
3443
OUTPUT_VARIABLE ${VARIABLE}
3544
OUTPUT_STRIP_TRAILING_WHITESPACE
3645
)
46+
if(${VARIABLE} STREQUAL "")
47+
message(
48+
FATAL_ERROR
49+
"Running the sed script ${PROJECT_SOURCE_DIR}/cmake/firebase_version.sed \
50+
on file ${PODSPEC_FILE} failed; ensure that the `sed` executable is \
51+
installed and that its directory is present in the PATH environment \
52+
variable."
53+
)
54+
endif()
3755
endmacro()
3856

3957
function(podspec_prep_headers FRAMEWORK_NAME)

0 commit comments

Comments
 (0)