Skip to content

Commit

Permalink
Merge pull request #1172 from jadh4v/fix-itkpipeline-arg-parsing-and-…
Browse files Browse the repository at this point in the history
…native-msvc-debug-build

Fix itkPipeline help stream parsing crash and native msvc static debug build
  • Loading branch information
thewtex authored Jul 8, 2024
2 parents 83772f2 + c3c39b7 commit f65c2a8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ endif()

set(WebAssemblyInterface_LIBRARIES WebAssemblyInterface)

if(MSVC) #-- Configure MSVC_STATIC_RUNTIME only if using MSVC environment
option(ITKWASM_MSVC_STATIC_RUNTIME_LIBRARY "Link to MSVC's static CRT (/MT and /MTd).
OFF (default) means link to regular, dynamic CRT (/MD and /MDd)." ON)
mark_as_advanced(ITKWASM_MSVC_STATIC_RUNTIME_LIBRARY)
set(ITKWASM_MSVC_STATIC_RUNTIME_LIBRARY_value ${ITK_MSVC_STATIC_RUNTIME_LIBRARY})
if(ITKWASM_MSVC_STATIC_RUNTIME_LIBRARY)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
message(STATUS "Using MSVC's static CRT (/MT and /MTd)")
else()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
message(STATUS "Using MSVC's dynamic CRT (/MD and /MDd)")
endif()
endif()

include(FetchContent)
set(_itk_build_testing ${BUILD_TESTING})
set(BUILD_TESTING OFF)
Expand Down
4 changes: 3 additions & 1 deletion src/itkPipeline.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ ::exit(const CLI::Error &e) -> int
#ifndef ITK_WASM_NO_FILESYSTEM_IO
std::cout << rang::fg::reset;
#endif
std::cout << line.substr(loc) << std::endl;
if (loc == std::string::npos) {
std::cout << line.substr(loc) << std::endl;
}
}
} else if(optionGroup) {
if (line == "") {
Expand Down

0 comments on commit f65c2a8

Please sign in to comment.