mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-26 00:00:39 -05:00
Merge topic 'macOS-sw_vers-stderr'
58aa659bf8Tests/RunCMake/cmake_host_system_information: Cover macOS Malloc Debugging env954afd528bMerge branch 'upstream-KWSys' into macOS-sw_vers-stderr295f4b1de1KWSys 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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user