Merge topic 'macOS-sw_vers-stderr'

58aa659bf8 Tests/RunCMake/cmake_host_system_information: Cover macOS Malloc Debugging env
954afd528b Merge branch 'upstream-KWSys' into macOS-sw_vers-stderr
295f4b1de1 KWSys 2024-11-23 (3e9b0b88)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10029
This commit is contained in:
Brad King
2024-11-25 15:03:01 +00:00
committed by Kitware Robot
4 changed files with 14 additions and 3 deletions
+6 -3
View File
@@ -4759,7 +4759,7 @@ std::string SystemInformationImplementation::ExtractValueFromSysCtl(
std::string SystemInformationImplementation::RunProcess(
std::vector<const char*> args)
{
std::string buffer;
std::string out;
// Run the application
kwsysProcess* gp = kwsysProcess_New();
@@ -4778,7 +4778,10 @@ std::string SystemInformationImplementation::RunProcess(
(pipe == kwsysProcess_Pipe_STDOUT ||
pipe == kwsysProcess_Pipe_STDERR))) // wait for 1s
{
buffer.append(data, length);
// Keep stdout, ignore stderr.
if (pipe == kwsysProcess_Pipe_STDOUT) {
out.append(data, length);
}
}
kwsysProcess_WaitForExit(gp, nullptr);
@@ -4808,7 +4811,7 @@ std::string SystemInformationImplementation::RunProcess(
if (result) {
std::cerr << "Error " << args[0] << " returned :" << result << "\n";
}
return buffer;
return out;
}
std::string SystemInformationImplementation::ParseValueFromKStat(
@@ -0,0 +1 @@
-- os_name='(macOS|Mac OS X)'
@@ -0,0 +1,3 @@
set(ENV{MallocGuardEdges} 1) # test tolerating sw_vers stderr
cmake_host_system_information(RESULT os_name QUERY OS_NAME)
message(STATUS "os_name='${os_name}'")
@@ -14,6 +14,10 @@ run_cmake(Ubuntu)
run_cmake(CentOS6)
run_cmake(Debian6)
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
run_cmake(MacOS)
endif()
run_cmake(UserFallbackScript)
if(RunCMake_GENERATOR MATCHES "Visual Studio")