Skip to content

Commit 80347b5

Browse files
Update dds-types-test submodule instead of fail build (#5640)
Signed-off-by: Miguel Company <[email protected]>
1 parent 7259840 commit 80347b5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/feature/idl_parser/CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,17 @@
1313
# limitations under the License.
1414

1515
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/thirdparty/dds-types-test/IDL")
16-
message(FATAL_ERROR "Folder thirdparty/dds-types-test/IDL does not exist. Submodule thirdparty/dds-types-test might not have been initialized.")
16+
# Update submodule
17+
message(STATUS "Updating submodule thirdparty/dds-types-test")
18+
execute_process(
19+
COMMAND git submodule update --recursive --init "thirdparty/dds-types-test"
20+
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
21+
RESULT_VARIABLE UPDATE_SUBMODULE_RESULT
22+
)
23+
# A result different than 0 means that the submodule could not be updated.
24+
if(NOT UPDATE_SUBMODULE_RESULT EQUAL 0)
25+
message(FATAL_ERROR "Cannot configure Git submodule thirdparty/dds-types-test")
26+
endif()
1727
endif()
1828

1929
if(WIN32)

0 commit comments

Comments
 (0)