File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,30 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1010
1111set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR} /cmake)
1212
13+ if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR} /.gitmodules" AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR} /.git" )
14+ find_package (Git QUIET )
15+ if (Git_FOUND)
16+ execute_process (
17+ COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
18+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
19+ RESULT_VARIABLE TILELANG_GIT_SUBMODULE_RESULT
20+ )
21+ if (NOT TILELANG_GIT_SUBMODULE_RESULT EQUAL 0)
22+ message (
23+ FATAL_ERROR
24+ "Failed to initialize git submodules. Please run "
25+ "`git submodule update --init --recursive` and re-run CMake."
26+ )
27+ endif ()
28+ else ()
29+ message (
30+ FATAL_ERROR
31+ "Git is required to initialize TileLang submodules. "
32+ "Please install git or fetch the submodules manually."
33+ )
34+ endif ()
35+ endif ()
36+
1337find_program (CCACHE_PROGRAM ccache)
1438if (CCACHE_PROGRAM)
1539 set (CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM} " CACHE STRING "C compiler launcher" )
You can’t perform that action at this time.
0 commit comments