Skip to content

Commit 5bebeb7

Browse files
committed
post-yas pull updates, redirect docker's macro output to DOCKER_OUTPUT_VAR, use "NBL_ENABLE_DOCKER_INTEGRATION", more validation and endpoint info logs
1 parent 995f666 commit 5bebeb7

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

CMakeLists.txt

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ option(NBL_BUILD_BULLET "Enable Bullet Physics building and integration?" OFF)
193193
option(NBL_BUILD_DOCS "Enable building documentation?" OFF) # No one has doxygen installed, plus we dont know when was the last time we generated working doxy and we'll use SphinX in the future
194194
option(NBL_ENABLE_PROJECT_JSON_CONFIG_VALIDATION "" ON)
195195
option(NBL_EMBED_BUILTIN_RESOURCES "Embed built-in resources?" ON)
196-
option(NBL_WITH_DOCKER "Enables docker integration, if client is not found Docker Desktop will be installed" OFF)
196+
option(NBL_ENABLE_DOCKER_INTEGRATION "Enables docker integration, if client is not found Docker Desktop will be installed" OFF)
197197

198-
if (NBL_WITH_DOCKER)
198+
if (NBL_ENABLE_DOCKER_INTEGRATION)
199199
if (NOT CMAKE_HOST_WIN32)
200-
message(FATAL_ERROR "NBL_WITH_DOCKER works only with Windows machines. Please disable this option")
200+
message(FATAL_ERROR "NBL_ENABLE_DOCKER_INTEGRATION works only with Windows host machines. Please disable this option")
201201
endif()
202202

203203
find_program(DOCKER_EXECUTABLE docker REQUIRED)
@@ -217,8 +217,7 @@ if (NBL_WITH_DOCKER)
217217
endif()
218218
endif()
219219

220-
# check if the docker daemon is running
221-
# DDT stands for Docker Daemon Test
220+
message(STATUS "Docker endpoint healty check..")
222221
set(DDT_MAX_ATTEMPTS 10)
223222
set(DDT_DOCKER_RESPONDING False)
224223
foreach(ATTEMPT RANGE 1 ${DDT_MAX_ATTEMPTS})
@@ -227,25 +226,30 @@ if (NBL_WITH_DOCKER)
227226

228227
if (DOCKER_EXIT_CODE EQUAL 0)
229228
set(DDT_DOCKER_RESPONDING True)
229+
message(STATUS "Docker endpoint detected, the engine is running.")
230+
message(STATUS "${DOCKER_OUTPUT_VAR}")
230231
break()
231232
endif()
232233

233234
NBL_WAIT_FOR(5)
234235
endforeach()
235236

236237
if (NOT DDT_DOCKER_RESPONDING)
237-
message(FATAL_ERROR "Docker Daemon is not responding. Please make sure it's running in the background")
238+
message(FATAL_ERROR "Docker Daemon is not responding. Please make sure it's running in the background!")
238239
endif()
239240

240241
set(DNT_NETWORK_NAME "docker_default")
241-
message(STATUS "Checking wether \"${DNT_NETWORK_NAME}\" docker network exist.")
242242
NBL_DOCKER(network inspect ${DNT_NETWORK_NAME})
243243
if (NOT DOCKER_EXIT_CODE EQUAL 0)
244-
message(STATUS "Docker network \"${DNT_NETWORK_NAME}\" doesn't exist. Creating one.'")
244+
message(STATUS "Default docker network doesn't exist, creating \"${DNT_NETWORK_NAME}\" network..")
245245
NBL_DOCKER(network create -d nat ${DNT_NETWORK_NAME})
246-
else()
247-
message(STATUS "Docker network \"${DNT_NETWORK_NAME}\" exists")
246+
247+
if (NOT DOCKER_EXIT_CODE EQUAL 0)
248+
message(STATUS "Could not create default docker \"${DNT_NETWORK_NAME}\" network!")
249+
endif()
248250
endif()
251+
252+
message(STATUS "Default docker network: \"${DNT_NETWORK_NAME}\"")
249253
endif()
250254

251255
set(THIRD_PARTY_SOURCE_DIR "${PROJECT_SOURCE_DIR}/3rdparty")

cmake/common.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,5 +1342,8 @@ endmacro()
13421342

13431343
# helper macro for calling docker, takes args as a list of strings
13441344
macro(NBL_DOCKER)
1345-
execute_process(COMMAND ${DOCKER_EXECUTABLE} ${ARGN} RESULT_VARIABLE DOCKER_EXIT_CODE OUTPUT_QUIET)
1345+
execute_process(COMMAND ${DOCKER_EXECUTABLE} ${ARGN}
1346+
RESULT_VARIABLE DOCKER_EXIT_CODE
1347+
OUTPUT_VARIABLE DOCKER_OUTPUT_VAR
1348+
)
13461349
endmacro()

tools/nsc/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ add_test(NAME NBL_NSC_DUMP_BUILD_INFO_TEST
5454
COMMAND_EXPAND_LISTS
5555
)
5656

57-
option(NBL_ENABLE_DOCKER_INTEGRATION "" OFF)
58-
5957
if(NBL_ENABLE_DOCKER_INTEGRATION)
6058

6159
find_program(DOCKER_EXE

0 commit comments

Comments
 (0)