Skip to content

Commit 14dee8f

Browse files
committed
play with debug CRTs and make nsc_d work with CE containers
1 parent cde3c03 commit 14dee8f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tools/nsc/CMakeLists.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,29 @@ set(NBL_DOCKER_CE_COMPOSE_TARGET "${GODBOLT_BINARY_DIRECTORY}/compose.yml")
121121

122122
include(InstallRequiredSystemLibraries)
123123

124+
string(REPLACE "v" "VC" TARGET_DCRT ${CMAKE_VS_PLATFORM_TOOLSET})
125+
set(DEBUG_CRT_DIRECTORY_SOURCE "${MSVC_REDIST_DIR}/debug_nonredist/x64/Microsoft.${TARGET_DCRT}.DebugCRT")
126+
127+
if(NOT EXISTS "${DEBUG_CRT_DIRECTORY_SOURCE}")
128+
message(FATAL_ERROR "DEBUG_CRT_DIRECTORY_SOURCE = \"${DEBUG_CRT_DIRECTORY_SOURCE}\" doesn't exist!")
129+
endif()
130+
131+
set(DEBUG_CRT_DIRECTORY_TARGET "${NBL_DOCKER_CT_NSC_VOLUME_SOURCE}/debug/${NBL_RELATIVE_ENTRY}")
132+
file(MAKE_DIRECTORY "${DEBUG_CRT_DIRECTORY_TARGET}")
133+
file(GLOB CRT_FILES "${DEBUG_CRT_DIRECTORY_SOURCE}/*")
134+
foreach(CRT_FILE ${CRT_FILES})
135+
if (NOT IS_DIRECTORY ${CRT_FILE})
136+
file(COPY "${CRT_FILE}" DESTINATION "${DEBUG_CRT_DIRECTORY_TARGET}")
137+
endif()
138+
endforeach()
139+
140+
find_file(UCRTBASED_DLL_PATH
141+
NAMES ucrtbased.dll
142+
REQUIRED
143+
)
144+
145+
file(COPY "${UCRTBASED_DLL_PATH}" DESTINATION "${DEBUG_CRT_DIRECTORY_TARGET}")
146+
124147
string(APPEND COMPOSE_CONTENT
125148
[=[
126149
services:

0 commit comments

Comments
 (0)