cmSystemTools.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #pragma once
  4. #include "cmConfigure.h" // IWYU pragma: keep
  5. #if !defined(_WIN32)
  6. # include <sys/types.h>
  7. #endif
  8. #include <cstddef>
  9. #include <functional>
  10. #include <map>
  11. #include <sstream>
  12. #include <string>
  13. #include <vector>
  14. #include <cm/optional>
  15. #include <cm/string_view>
  16. #include <cm3p/uv.h>
  17. #include "cmsys/Status.hxx" // IWYU pragma: export
  18. #include "cmsys/SystemTools.hxx" // IWYU pragma: export
  19. #include "cmDuration.h"
  20. #include "cmProcessOutput.h"
  21. struct cmMessageMetadata;
  22. /** \class cmSystemTools
  23. * \brief A collection of useful functions for CMake.
  24. *
  25. * cmSystemTools is a class that provides helper functions
  26. * for the CMake build system.
  27. */
  28. class cmSystemTools : public cmsys::SystemTools
  29. {
  30. public:
  31. using Superclass = cmsys::SystemTools;
  32. using Encoding = cmProcessOutput::Encoding;
  33. /**
  34. * Return a lower case string
  35. */
  36. static std::string LowerCase(cm::string_view);
  37. static std::string LowerCase(char const* s)
  38. {
  39. return LowerCase(cm::string_view{ s });
  40. }
  41. using cmsys::SystemTools::LowerCase;
  42. /**
  43. * Return an upper case string
  44. */
  45. static std::string UpperCase(cm::string_view);
  46. static std::string UpperCase(char const* s)
  47. {
  48. return UpperCase(cm::string_view{ s });
  49. }
  50. using cmsys::SystemTools::UpperCase;
  51. /**
  52. * Look for and replace registry values in a string
  53. */
  54. static void ExpandRegistryValues(std::string& source,
  55. KeyWOW64 view = KeyWOW64_Default);
  56. /** Map help document name to file name. */
  57. static std::string HelpFileName(cm::string_view);
  58. using MessageCallback =
  59. std::function<void(const std::string&, const cmMessageMetadata&)>;
  60. /**
  61. * Set the function used by GUIs to display error messages
  62. * Function gets passed: message as a const char*,
  63. * title as a const char*.
  64. */
  65. static void SetMessageCallback(MessageCallback f);
  66. /**
  67. * Display an error message.
  68. */
  69. static void Error(const std::string& m);
  70. /**
  71. * Display a message.
  72. */
  73. static void Message(const std::string& m, const char* title = nullptr);
  74. static void Message(const std::string& m, const cmMessageMetadata& md);
  75. using OutputCallback = std::function<void(std::string const&)>;
  76. //! Send a string to stdout
  77. static void Stdout(const std::string& s);
  78. static void SetStdoutCallback(OutputCallback f);
  79. //! Send a string to stderr
  80. static void Stderr(const std::string& s);
  81. static void SetStderrCallback(OutputCallback f);
  82. using InterruptCallback = std::function<bool()>;
  83. static void SetInterruptCallback(InterruptCallback f);
  84. static bool GetInterruptFlag();
  85. //! Return true if there was an error at any point.
  86. static bool GetErrorOccurredFlag()
  87. {
  88. return cmSystemTools::s_ErrorOccurred ||
  89. cmSystemTools::s_FatalErrorOccurred || GetInterruptFlag();
  90. }
  91. //! If this is set to true, cmake stops processing commands.
  92. static void SetFatalErrorOccurred()
  93. {
  94. cmSystemTools::s_FatalErrorOccurred = true;
  95. }
  96. static void SetErrorOccurred() { cmSystemTools::s_ErrorOccurred = true; }
  97. //! Return true if there was an error at any point.
  98. static bool GetFatalErrorOccurred()
  99. {
  100. return cmSystemTools::s_FatalErrorOccurred || GetInterruptFlag();
  101. }
  102. //! Set the error occurred flag and fatal error back to false
  103. static void ResetErrorOccurredFlag()
  104. {
  105. cmSystemTools::s_FatalErrorOccurred = false;
  106. cmSystemTools::s_ErrorOccurred = false;
  107. }
  108. //! Return true if the path is a framework
  109. static bool IsPathToFramework(const std::string& path);
  110. //! Return true if the path is a xcframework
  111. static bool IsPathToXcFramework(const std::string& path);
  112. //! Return true if the path is a macOS non-framework shared library (aka
  113. //! .dylib)
  114. static bool IsPathToMacOSSharedLibrary(const std::string& path);
  115. static bool DoesFileExistWithExtensions(
  116. const std::string& name, const std::vector<std::string>& sourceExts);
  117. /**
  118. * Check if the given file exists in one of the parent directory of the
  119. * given file or directory and if it does, return the name of the file.
  120. * Toplevel specifies the top-most directory to where it will look.
  121. */
  122. static std::string FileExistsInParentDirectories(
  123. const std::string& fname, const std::string& directory,
  124. const std::string& toplevel);
  125. static void Glob(const std::string& directory, const std::string& regexp,
  126. std::vector<std::string>& files);
  127. static void GlobDirs(const std::string& fullPath,
  128. std::vector<std::string>& files);
  129. /**
  130. * Try to find a list of files that match the "simple" globbing
  131. * expression. At this point in time the globbing expressions have
  132. * to be in form: /directory/partial_file_name*. The * character has
  133. * to be at the end of the string and it does not support ?
  134. * []... The optional argument type specifies what kind of files you
  135. * want to find. 0 means all files, -1 means directories, 1 means
  136. * files only. This method returns true if search was successful.
  137. */
  138. static bool SimpleGlob(const std::string& glob,
  139. std::vector<std::string>& files, int type = 0);
  140. enum class CopyWhen
  141. {
  142. Always,
  143. OnlyIfDifferent,
  144. };
  145. enum class CopyInputRecent
  146. {
  147. No,
  148. Yes,
  149. };
  150. enum class CopyResult
  151. {
  152. Success,
  153. Failure,
  154. };
  155. #if defined(_MSC_VER)
  156. /** Visual C++ does not define mode_t. */
  157. using mode_t = unsigned short;
  158. #endif
  159. /**
  160. * Make a new temporary directory. The path must end in "XXXXXX", and will
  161. * be modified to reflect the name of the directory created. This function
  162. * is similar to POSIX mkdtemp (and is implemented using the same where that
  163. * function is available).
  164. *
  165. * This function can make a full path even if none of the directories existed
  166. * prior to calling this function.
  167. *
  168. * Note that this function may modify \p path even if it does not succeed.
  169. */
  170. static cmsys::Status MakeTempDirectory(char* path,
  171. const mode_t* mode = nullptr);
  172. static cmsys::Status MakeTempDirectory(std::string& path,
  173. const mode_t* mode = nullptr);
  174. /** Copy a file. */
  175. static CopyResult CopySingleFile(std::string const& oldname,
  176. std::string const& newname, CopyWhen when,
  177. CopyInputRecent inputRecent,
  178. std::string* err = nullptr);
  179. enum class Replace
  180. {
  181. Yes,
  182. No,
  183. };
  184. enum class RenameResult
  185. {
  186. Success,
  187. NoReplace,
  188. Failure,
  189. };
  190. /** Rename a file or directory within a single disk volume (atomic
  191. if possible). */
  192. static bool RenameFile(const std::string& oldname,
  193. const std::string& newname);
  194. static RenameResult RenameFile(std::string const& oldname,
  195. std::string const& newname, Replace replace,
  196. std::string* err = nullptr);
  197. //! Rename a file if contents are different, delete the source otherwise
  198. static cmsys::Status MoveFileIfDifferent(const std::string& source,
  199. const std::string& destination);
  200. /**
  201. * Run a single executable command
  202. *
  203. * Output is controlled with outputflag. If outputflag is OUTPUT_NONE, no
  204. * user-viewable output from the program being run will be generated.
  205. * OUTPUT_MERGE is the legacy behavior where stdout and stderr are merged
  206. * into stdout. OUTPUT_FORWARD copies the output to stdout/stderr as
  207. * it was received. OUTPUT_PASSTHROUGH passes through the original handles.
  208. *
  209. * If timeout is specified, the command will be terminated after
  210. * timeout expires. Timeout is specified in seconds.
  211. *
  212. * Argument retVal should be a pointer to the location where the
  213. * exit code will be stored. If the retVal is not specified and
  214. * the program exits with a code other than 0, then the this
  215. * function will return false.
  216. *
  217. * If the command has spaces in the path the caller MUST call
  218. * cmSystemTools::ConvertToRunCommandPath on the command before passing
  219. * it into this function or it will not work. The command must be correctly
  220. * escaped for this to with spaces.
  221. */
  222. enum OutputOption
  223. {
  224. OUTPUT_NONE = 0,
  225. OUTPUT_MERGE,
  226. OUTPUT_FORWARD,
  227. OUTPUT_PASSTHROUGH
  228. };
  229. static bool RunSingleCommand(const std::string& command,
  230. std::string* captureStdOut = nullptr,
  231. std::string* captureStdErr = nullptr,
  232. int* retVal = nullptr,
  233. const char* dir = nullptr,
  234. OutputOption outputflag = OUTPUT_MERGE,
  235. cmDuration timeout = cmDuration::zero());
  236. /**
  237. * In this version of RunSingleCommand, command[0] should be
  238. * the command to run, and each argument to the command should
  239. * be in command[1]...command[command.size()]
  240. */
  241. static bool RunSingleCommand(std::vector<std::string> const& command,
  242. std::string* captureStdOut = nullptr,
  243. std::string* captureStdErr = nullptr,
  244. int* retVal = nullptr,
  245. const char* dir = nullptr,
  246. OutputOption outputflag = OUTPUT_MERGE,
  247. cmDuration timeout = cmDuration::zero(),
  248. Encoding encoding = cmProcessOutput::Auto);
  249. static std::string PrintSingleCommand(std::vector<std::string> const&);
  250. /**
  251. * Parse arguments out of a single string command
  252. */
  253. static std::vector<std::string> ParseArguments(const std::string& command);
  254. /** Parse arguments out of a windows command line string. */
  255. static void ParseWindowsCommandLine(const char* command,
  256. std::vector<std::string>& args);
  257. /** Parse arguments out of a unix command line string. */
  258. static void ParseUnixCommandLine(const char* command,
  259. std::vector<std::string>& args);
  260. /** Split a command-line string into the parsed command and the unparsed
  261. arguments. Returns false on unfinished quoting or escaping. */
  262. static bool SplitProgramFromArgs(std::string const& command,
  263. std::string& program, std::string& args);
  264. /**
  265. * Handle response file in an argument list and return a new argument list
  266. * **/
  267. static std::vector<std::string> HandleResponseFile(
  268. std::vector<std::string>::const_iterator argBeg,
  269. std::vector<std::string>::const_iterator argEnd);
  270. static std::size_t CalculateCommandLineLengthLimit();
  271. static void DisableRunCommandOutput() { s_DisableRunCommandOutput = true; }
  272. static void EnableRunCommandOutput() { s_DisableRunCommandOutput = false; }
  273. static bool GetRunCommandOutput() { return s_DisableRunCommandOutput; }
  274. enum CompareOp
  275. {
  276. OP_EQUAL = 1,
  277. OP_LESS = 2,
  278. OP_GREATER = 4,
  279. OP_LESS_EQUAL = OP_LESS | OP_EQUAL,
  280. OP_GREATER_EQUAL = OP_GREATER | OP_EQUAL
  281. };
  282. /**
  283. * Compare versions
  284. */
  285. static bool VersionCompare(CompareOp op, const std::string& lhs,
  286. const std::string& rhs);
  287. static bool VersionCompare(CompareOp op, const std::string& lhs,
  288. const char rhs[]);
  289. static bool VersionCompareEqual(std::string const& lhs,
  290. std::string const& rhs);
  291. static bool VersionCompareGreater(std::string const& lhs,
  292. std::string const& rhs);
  293. static bool VersionCompareGreaterEq(std::string const& lhs,
  294. std::string const& rhs);
  295. /**
  296. * Compare two ASCII strings using natural versioning order.
  297. * Non-numerical characters are compared directly.
  298. * Numerical characters are first globbed such that, e.g.
  299. * `test000 < test01 < test0 < test1 < test10`.
  300. * Return a value less than, equal to, or greater than zero if lhs
  301. * precedes, equals, or succeeds rhs in the defined ordering.
  302. */
  303. static int strverscmp(std::string const& lhs, std::string const& rhs);
  304. /** Windows if this is true, the CreateProcess in RunCommand will
  305. * not show new console windows when running programs.
  306. */
  307. static void SetRunCommandHideConsole(bool v) { s_RunCommandHideConsole = v; }
  308. static bool GetRunCommandHideConsole() { return s_RunCommandHideConsole; }
  309. /** Call cmSystemTools::Error with the message m, plus the
  310. * result of strerror(errno)
  311. */
  312. static void ReportLastSystemError(const char* m);
  313. enum class WaitForLineResult
  314. {
  315. None,
  316. STDOUT,
  317. STDERR,
  318. Timeout,
  319. };
  320. /** a general output handler for libuv */
  321. static WaitForLineResult WaitForLine(uv_loop_t* loop, uv_stream_t* outPipe,
  322. uv_stream_t* errPipe, std::string& line,
  323. cmDuration timeout,
  324. std::vector<char>& out,
  325. std::vector<char>& err);
  326. static void SetForceUnixPaths(bool v) { s_ForceUnixPaths = v; }
  327. static bool GetForceUnixPaths() { return s_ForceUnixPaths; }
  328. // ConvertToOutputPath use s_ForceUnixPaths
  329. static std::string ConvertToOutputPath(std::string const& path);
  330. static void ConvertToOutputSlashes(std::string& path);
  331. // ConvertToRunCommandPath does not use s_ForceUnixPaths and should
  332. // be used when RunCommand is called from cmake, because the
  333. // running cmake needs paths to be in its format
  334. static std::string ConvertToRunCommandPath(const std::string& path);
  335. /**
  336. * For windows computes the long path for the given path,
  337. * For Unix, it is a noop
  338. */
  339. static void ConvertToLongPath(std::string& path);
  340. /** compute the relative path from local to remote. local must
  341. be a directory. remote can be a file or a directory.
  342. Both remote and local must be full paths. Basically, if
  343. you are in directory local and you want to access the file in remote
  344. what is the relative path to do that. For example:
  345. /a/b/c/d to /a/b/c1/d1 -> ../../c1/d1
  346. from /usr/src to /usr/src/test/blah/foo.cpp -> test/blah/foo.cpp
  347. */
  348. static std::string RelativePath(std::string const& local,
  349. std::string const& remote);
  350. /**
  351. * Convert the given remote path to a relative path with respect to
  352. * the given local path. Both paths must use forward slashes and not
  353. * already be escaped or quoted.
  354. */
  355. static std::string ForceToRelativePath(std::string const& local_path,
  356. std::string const& remote_path);
  357. /**
  358. * Express the 'in' path relative to 'top' if it does not start in '../'.
  359. */
  360. static std::string RelativeIfUnder(std::string const& top,
  361. std::string const& in);
  362. static cm::optional<std::string> GetEnvVar(std::string const& var);
  363. static std::vector<std::string> GetEnvPathNormalized(std::string const& var);
  364. static std::vector<std::string> SplitEnvPath(cm::string_view in);
  365. static std::vector<std::string> SplitEnvPathNormalized(cm::string_view in);
  366. /** Convert an input path to an absolute path with no '/..' components.
  367. Backslashes in the input path are converted to forward slashes.
  368. Relative paths are interpreted w.r.t. GetLogicalWorkingDirectory.
  369. On Windows, the on-disk capitalization is loaded for existing paths.
  370. This is similar to 'realpath', but preserves symlinks that are
  371. not erased by '../' components. */
  372. static std::string ToNormalizedPathOnDisk(std::string p);
  373. #ifndef CMAKE_BOOTSTRAP
  374. /** Remove an environment variable */
  375. static bool UnsetEnv(const char* value);
  376. /** Get the list of all environment variables */
  377. static std::vector<std::string> GetEnvironmentVariables();
  378. /** Append multiple variables to the current environment. */
  379. static void AppendEnv(std::vector<std::string> const& env);
  380. /**
  381. * Helper class to represent an environment diff directly. This is to avoid
  382. * repeated in-place environment modification (i.e. via setenv/putenv), which
  383. * could be slow.
  384. */
  385. class EnvDiff
  386. {
  387. public:
  388. /** Append multiple variables to the current environment diff */
  389. void AppendEnv(std::vector<std::string> const& env);
  390. /**
  391. * Add a single variable (or remove if no = sign) to the current
  392. * environment diff.
  393. */
  394. void PutEnv(const std::string& env);
  395. /** Remove a single variable from the current environment diff. */
  396. void UnPutEnv(const std::string& env);
  397. /**
  398. * Apply an ENVIRONMENT_MODIFICATION operation to this diff. Returns
  399. * false and issues an error on parse failure.
  400. */
  401. bool ParseOperation(const std::string& envmod);
  402. /**
  403. * Apply this diff to the actual environment, optionally writing out the
  404. * modifications to a CTest-compatible measurement stream.
  405. */
  406. void ApplyToCurrentEnv(std::ostringstream* measurement = nullptr);
  407. private:
  408. std::map<std::string, cm::optional<std::string>> diff;
  409. };
  410. /** Helper class to save and restore the environment.
  411. Instantiate this class as an automatic variable on
  412. the stack. Its constructor saves a copy of the current
  413. environment and then its destructor restores the
  414. original environment. */
  415. class SaveRestoreEnvironment
  416. {
  417. public:
  418. SaveRestoreEnvironment();
  419. ~SaveRestoreEnvironment();
  420. SaveRestoreEnvironment(SaveRestoreEnvironment const&) = delete;
  421. SaveRestoreEnvironment& operator=(SaveRestoreEnvironment const&) = delete;
  422. private:
  423. std::vector<std::string> Env;
  424. };
  425. #endif
  426. /** Setup the environment to enable VS 8 IDE output. */
  427. static void EnableVSConsoleOutput();
  428. enum cmTarAction
  429. {
  430. TarActionCreate,
  431. TarActionList,
  432. TarActionExtract,
  433. TarActionNone
  434. };
  435. /** Create tar */
  436. enum cmTarCompression
  437. {
  438. TarCompressGZip,
  439. TarCompressBZip2,
  440. TarCompressXZ,
  441. TarCompressZstd,
  442. TarCompressNone
  443. };
  444. enum class cmTarExtractTimestamps
  445. {
  446. Yes,
  447. No
  448. };
  449. static bool ListTar(const std::string& outFileName,
  450. const std::vector<std::string>& files, bool verbose);
  451. static bool CreateTar(const std::string& outFileName,
  452. const std::vector<std::string>& files,
  453. const std::string& workingDirectory,
  454. cmTarCompression compressType, bool verbose,
  455. std::string const& mtime = std::string(),
  456. std::string const& format = std::string(),
  457. int compressionLevel = 0);
  458. static bool ExtractTar(const std::string& inFileName,
  459. const std::vector<std::string>& files,
  460. cmTarExtractTimestamps extractTimestamps,
  461. bool verbose);
  462. static void EnsureStdPipes();
  463. /** Random seed generation. */
  464. static unsigned int RandomSeed();
  465. /** Find the directory containing CMake executables. */
  466. static void FindCMakeResources(const char* argv0);
  467. /** Get the CMake resource paths, after FindCMakeResources. */
  468. static std::string const& GetCTestCommand();
  469. static std::string const& GetCPackCommand();
  470. static std::string const& GetCMakeCommand();
  471. static std::string const& GetCMakeGUICommand();
  472. static std::string const& GetCMakeCursesCommand();
  473. static std::string const& GetCMClDepsCommand();
  474. static std::string const& GetCMakeRoot();
  475. static std::string const& GetHTMLDoc();
  476. /** Get the CMake config directory **/
  477. static cm::optional<std::string> GetSystemConfigDirectory();
  478. static cm::optional<std::string> GetCMakeConfigDirectory();
  479. static std::string const& GetLogicalWorkingDirectory();
  480. /** The logical working directory may contain symlinks but must not
  481. contain any '../' path components. */
  482. static cmsys::Status SetLogicalWorkingDirectory(std::string const& lwd);
  483. /** Echo a message in color using KWSys's Terminal cprintf. */
  484. static void MakefileColorEcho(int color, const char* message, bool newLine,
  485. bool enabled);
  486. /** Try to guess the soname of a shared library. */
  487. static bool GuessLibrarySOName(std::string const& fullPath,
  488. std::string& soname);
  489. /** Try to guess the install name of a shared library. */
  490. static bool GuessLibraryInstallName(std::string const& fullPath,
  491. std::string& soname);
  492. /** Try to change the RPATH in an ELF binary. */
  493. static bool ChangeRPath(std::string const& file, std::string const& oldRPath,
  494. std::string const& newRPath,
  495. bool removeEnvironmentRPath,
  496. std::string* emsg = nullptr,
  497. bool* changed = nullptr);
  498. /** Try to set the RPATH in an ELF binary. */
  499. static bool SetRPath(std::string const& file, std::string const& newRPath,
  500. std::string* emsg = nullptr, bool* changed = nullptr);
  501. /** Try to remove the RPATH from an ELF binary. */
  502. static bool RemoveRPath(std::string const& file, std::string* emsg = nullptr,
  503. bool* removed = nullptr);
  504. /** Check whether the RPATH in an ELF binary contains the path
  505. given. */
  506. static bool CheckRPath(std::string const& file, std::string const& newRPath);
  507. /** Remove a directory; repeat a few times in case of locked files. */
  508. static bool RepeatedRemoveDirectory(const std::string& dir);
  509. /** Encode a string as a URL. */
  510. static std::string EncodeURL(std::string const& in,
  511. bool escapeSlashes = true);
  512. #ifdef _WIN32
  513. struct WindowsFileRetry
  514. {
  515. unsigned int Count;
  516. unsigned int Delay;
  517. };
  518. static WindowsFileRetry GetWindowsFileRetry();
  519. static WindowsFileRetry GetWindowsDirectoryRetry();
  520. struct WindowsVersion
  521. {
  522. unsigned int dwMajorVersion;
  523. unsigned int dwMinorVersion;
  524. unsigned int dwBuildNumber;
  525. };
  526. static WindowsVersion GetWindowsVersion();
  527. /** Attempt to get full path to COMSPEC, default "cmd.exe" */
  528. static std::string GetComspec();
  529. #endif
  530. /** Get the real path for a given path, removing all symlinks. */
  531. static std::string GetRealPath(const std::string& path,
  532. std::string* errorMessage = nullptr);
  533. /** Perform one-time initialization of libuv. */
  534. static void InitializeLibUV();
  535. /** Create a symbolic link if the platform supports it. Returns whether
  536. creation succeeded. */
  537. static cmsys::Status CreateSymlink(std::string const& origName,
  538. std::string const& newName);
  539. static cmsys::Status CreateSymlinkQuietly(std::string const& origName,
  540. std::string const& newName);
  541. /** Create a hard link if the platform supports it. Returns whether
  542. creation succeeded. */
  543. static cmsys::Status CreateLink(std::string const& origName,
  544. std::string const& newName);
  545. static cmsys::Status CreateLinkQuietly(std::string const& origName,
  546. std::string const& newName);
  547. /** Get the system name. */
  548. static cm::string_view GetSystemName();
  549. /** Get the system path separator character */
  550. static char GetSystemPathlistSeparator();
  551. private:
  552. static bool s_ForceUnixPaths;
  553. static bool s_RunCommandHideConsole;
  554. static bool s_ErrorOccurred;
  555. static bool s_FatalErrorOccurred;
  556. static bool s_DisableRunCommandOutput;
  557. };