Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

[cmake] check if submodule dir is empty (#182)

crueter9966da9ff356
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f775cdf87b..fd7c1817fb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -252,7 +252,10 @@ function(check_submodules_present)
string(REGEX MATCHALL "path *= *[^ \t\r\n]*" gitmodules ${gitmodules})
foreach(module ${gitmodules})
string(REGEX REPLACE "path *= *" "" module ${module})
- if (NOT EXISTS "${PROJECT_SOURCE_DIR}/${module}/.git")
+
+ file(GLOB RESULT "${PROJECT_SOURCE_DIR}/${module}/*")
+ list(LENGTH RESULT RES_LEN)
+ if(RES_LEN EQUAL 0)
message(FATAL_ERROR "Git submodule ${module} not found. "
"Please run: \ngit submodule update --init --recursive")
endif()