aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/CMakeMillerFuncs.cmake14
-rw-r--r--cmake/CMakeMillerHostTools.cmake8
2 files changed, 22 insertions, 0 deletions
diff --git a/cmake/CMakeMillerFuncs.cmake b/cmake/CMakeMillerFuncs.cmake
index a919904..223819b 100644
--- a/cmake/CMakeMillerFuncs.cmake
+++ b/cmake/CMakeMillerFuncs.cmake
@@ -83,3 +83,17 @@ function(CompileCSource source result cflags defs incl libs quiet)
CHECK_C_SOURCE_COMPILES("${source}" ${result})
endfunction()
+function(CloneGitSubmodule path)
+ find_package(Git QUIET)
+ option(GIT_SUBMODULE "Clone git submodules during build" ON)
+ if(GIT_SUBMODULE)
+ message(STATUS "Git Submodule update: ${GIT_EXECUTABLE} submodule update --init --recursive -- ${path}")
+ execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive -- "${path}"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ RESULT_VARIABLE GIT_SUBMOD_RESULT
+ ERROR_QUIET OUTPUT_QUIET)
+ if(NOT GIT_SUBMOD_RESULT EQUAL "0")
+ message(FATAL_ERROR "Git Submodule update failed with ${GIT_SUBMOD_RESULT}.")
+ endif()
+ endif()
+endfunction()
diff --git a/cmake/CMakeMillerHostTools.cmake b/cmake/CMakeMillerHostTools.cmake
index 8a06cb0..b5870ae 100644
--- a/cmake/CMakeMillerHostTools.cmake
+++ b/cmake/CMakeMillerHostTools.cmake
@@ -84,6 +84,14 @@ add_custom_target(strings
DEPENDS ${HOST_TOOLS_MKSTAMP} ${STRINGS_EXEC}
)
+if (BUILD_CNCMASTER)
+ CloneGitSubmodule(source/tools/host/go/cncmaster/deps/src/github.com/gorilla/mux)
+endif()
+if (BUILD_CNCPROXY)
+ CloneGitSubmodule(source/tools/host/go/cncproxy/deps/src/github.com/gorilla/mux)
+ CloneGitSubmodule(source/tools/host/go/cncproxy/deps/src/github.com/zhuangsirui/binpacker)
+endif()
+
if (BUILD_CNCPROXY)
add_custom_target(
cncproxy