1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-17 17:32:18 +08:00

814 Commits

Author SHA1 Message Date
Marc Chevrier
59ad7a1c24 Move helpers functions from cmStringAlgorithms.h to cmValue.h
Helpers functions related to cmValue semantic are now part of
cmValue.h header.
2021-09-21 18:11:00 +02:00
Marc Chevrier
7e154ebd59 cmSystemTools::VersionCompare: use std::string for arguments 2021-09-17 11:58:46 +02:00
Lucas SOLTIC
6ef7bfbb64 Xcode: add support for embedding dynamic libraries 2021-09-14 08:39:22 +10:00
Brad King
20fec15204 cmArchiveWrite: Check for construction errors on Open
Also update call sites to report the error.

Issue: #19666
2021-08-20 11:23:20 -04:00
Alex Richardson
115ff6a347 cmELF: Include the ELF parsing code unconditionally
Now that the ELF definitions are provided on all platforms there is no
need to keep the CMake_USE_ELF_PARSER option.
2021-06-24 10:57:51 -04:00
Alex Richardson
0da1540aaa cmELF: Fix check for TagMipsRldMapRel
DT_MIPS_RLD_MAP_REL is a machine-speicific dynamic tag, so other
architectures could re-use the value of 0x70000035 to mean something
else.  Before using DT_MIPS_RLD_MAP_REL, we have to check that the ELF
file is actually has a e_machine of EM_MIPS.
2021-06-24 10:57:51 -04:00
Alex Richardson
2e1149874d cmSystemTools: Support multiple binary formats
This prepares the code to handle both the ELF and XCOFF being enabled by
trying to parse an ELF file first and if that fails falling back to XCOFF.
2021-06-21 09:36:39 -04:00
Kyle Edwards
f73027b182 cmSystemTools: Add SetRPath() method 2021-06-04 08:52:01 -04:00
Kyle Edwards
966f7250df Refactor: Break up logic in cmSystemTools::ChangeRPath() 2021-06-04 08:52:01 -04:00
Marius Messerschmidt
bceb8e2ed2 cmMessenger: Pass title inside a metadata structure 2021-05-19 09:06:27 -04:00
Brad King
5b3a71a83f cmSystemTools: Adopt RelativeIfUnder helper
This returns a relative path if it does not start in `../`.
2021-05-17 10:02:16 -04:00
Brad King
d7522b8f86 cmSystemTools: Improve CreateLink and CreateSymlink error codes
In commit 7f89053953 (cmSystemTools: Return KWSys Status from CreateLink
and CreateSymlink, 2021-04-15) we just took the `-err` from libuv and
treated it as a POSIX error.  This is accurate on POSIX, but on Windows
does not match the POSIX error codes.

Use `uv_fs_get_system_error` to get the actual system error code.
This requires libuv 1.38 or higher.  Require that for Windows, but
fall back to the previous approach on POSIX.
2021-05-07 08:30:52 -04:00
Brad King
e2ac92681c Merge topic 'nvhpc-warnings'
f881b4e4cc cmCPackDebGenerator: Remove unused local variable
5ad8862318 Source: Convince NVHPC that RAII variables are used
1898f9dd82 cmFileCommand: Remove unused local variable
6a003c6f35 cmSystemTools: Avoid unreachable code warning on NVHPC
16275c7f82 LexerParser: Suppress NVHPC warnings in generated code
cefda16d35 LexerParser: Regenerate parsers with bison 3.7.5

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6049
2021-04-29 09:21:37 -04:00
Brad King
6a003c6f35 cmSystemTools: Avoid unreachable code warning on NVHPC 2021-04-28 10:09:52 -04:00
Orgad Shaneh
ddcd1469e8 MSYS: Add support for running under MSYS runtime environment
Detect MSYS as CYGWIN, with the required adaptations.
2021-04-26 14:27:34 -04:00
Brad King
7f89053953 cmSystemTools: Return KWSys Status from CreateLink and CreateSymlink 2021-04-15 12:40:37 -04:00
Brad King
3ef5dab010 cmSystemTools: Simplify using KWSys Status 2021-04-14 13:14:29 -04:00
Brad King
ec1b6157cb Update CMake code using KWSys to account for Status return values
KWSys as of 2021-04-14 changed the return type of `SystemTools`
operations from `bool` to `Status`.  Update our call sites.
This may improve error reporting accuracy in a few places.
2021-04-14 13:14:09 -04:00
Brad King
7981602368 Merge topic 'openbsd-defines'
317a477283 OpenBSD: Fix system feature definitions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6000
2021-04-14 11:04:30 -04:00
Rafael Sadowski
317a477283 OpenBSD: Fix system feature definitions
Since commit f034b0f663 (CMake compilation: do not use compiler
extensions, 2020-03-14, v3.18.0-rc1~494^2), some sources explicitly
enable needed system APIs on some platforms using definitions like
`_POSIX_C_SOURCE` and `_XOPEN_SOURCE`.  Drop the definitions for
OpenBSD, which provides the POSIX APIs by default.
2021-04-14 11:02:29 -04:00
Kyle Edwards
ad19da011d Refactor: Add cmSystemTools::GetSystemName()
And use it for CMAKE_HOST_SYSTEM_NAME and CMAKE_SYSTEM_NAME.
2021-03-15 14:41:42 -04:00
Ben Boeckel
100016e9cb cmSystemTools: add utilities to copy a file with error handling 2021-03-09 09:47:26 -05:00
Brad King
3600c6cd8c cmSystemTools: Add RenameFile option to not replace destination 2021-03-04 08:47:31 -05:00
Brad King
0c2dc34504 cmSystemTools: Add RenameFile signature to capture the error message 2021-03-04 08:26:21 -05:00
Brad King
e017ba046c AIX: Enable XCOFF editing to replace RPATH on installation
Avoid relinking before installation.
2021-02-03 12:26:58 -05:00
Brad King
cdcfe3eb99 Rename CMAKE_USE_MACH_PARSER to CMake_USE_MACH_PARSER
We use the `CMake_` prefix for options affecting CMake itself.
2021-02-03 11:35:31 -05:00
Brad King
b6071c93f5 Rename CMAKE_USE_ELF_PARSER to CMake_USE_ELF_PARSER
We use the `CMake_` prefix for options affecting CMake itself.
2021-02-03 11:35:31 -05:00
Ben Boeckel
c826461d9c clang-tidy: fix bugprone-reserved-identifier warnings 2021-01-27 08:45:44 -05:00
Marc Chevrier
8ec7408d74 Makefile dependencies: ensure long paths are used on Windows 2021-01-09 11:35:00 +01:00
Brad King
92021198e5 cmSystemTools: Revert use of MOVEFILE_WRITE_THROUGH by RenameFile on Windows
Revert commit d78c22aa64 (cmSystemTools: Improve RenameFile on Windows
with MOVEFILE_WRITE_THROUGH, 2020-08-25, v3.19.0-rc1~243^2~3).  Using
this flag causes the operation to fail frequently in some environments.
Drop it for now pending further investigation.

Fixes: #21571
2020-12-17 08:35:38 -05:00
Kyle Edwards
0fe2ee3d43 CMake GUI: Add "CMake Reference Manual" help item
And switch the ordering of "Help" and "About".
2020-09-30 16:17:31 -04:00
Kyle Edwards
391ff1ec51 Refactor: Modernize cmSystemTools::FindCMakeResources()
Use cmStrCat(), cmStrLen(), and cmHasLiteralSuffix().
2020-09-30 16:13:10 -04:00
Elad Lahav
f9e950d4c5 libuv: Add support for building for QNX within CMake 2020-09-25 11:53:44 -04:00
Asit Dhal
195d14e781 file(ARCHIVE_CREATE): Add option to control compression level
Fixes: #21125
2020-09-21 13:08:11 -04:00
Ron W Moore
e39e9c4043 cmSystemTools: Teach RenameFile to disable Windows Search Indexing
Create RAII class SaveRestoreFileAttributes to manage Windows Search
Indexing.  Turn it off temporarily while renaming a directory.

Issue: #19580
2020-08-31 13:03:36 -04:00
Ron W Moore
b54190a406 cmSystemTools: Teach RenameFile to try for longer on directories
Issue: #19580
2020-08-31 13:03:36 -04:00
Ron W Moore
2f8ef095da cmSystemTools: Add more error handling to RenameFile on Windows
Issue: #19580
2020-08-31 13:03:36 -04:00
Ron W Moore
d78c22aa64 cmSystemTools: Improve RenameFile on Windows with MOVEFILE_WRITE_THROUGH
Add this flag to tell `MoveFileExW` to flush the rename to disk before
returning.

Issue: #19580
2020-08-31 13:03:36 -04:00
Ron W Moore
73f8240ae7 cmSystemTools: Factor out RenameFile wstring conversion on Windows 2020-08-31 13:03:36 -04:00
Brad King
97fc44f70e cmSystemTools: Factor out MoveFileExW call in RenameFile 2020-08-31 13:03:11 -04:00
Brad King
35039286eb cmSystemTools: Define directory-specific Windows filesystem retry settings
Inspired-by: Ron W Moore <webbtrail@gmail.com>
2020-08-27 17:02:03 -04:00
Vitaly Stakhovsky
8ef18e8525 Clean a few string conversions 2020-07-09 09:42:00 -04:00
Brad King
977f5ed3d1 Merge topic 'restore-cwd-translation-map'
85a945a607 Restore handling of build directory inside a symlinked path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4963
2020-07-03 07:25:31 -04:00
Brad King
85a945a607 Restore handling of build directory inside a symlinked path
In commit dd8365b3f1 (Merge branch 'upstream-KWSys' into update-kwsys,
2020-04-06, v3.18.0-rc1~397^2) we imported KWSys commit `019afb6ea`
(SystemTools: Drop GetCurrentWorkingDirectory 'collapse' argument,
2020-04-03).  That caused `GetCurrentWorkingDirectory` to no longer send
paths through the KWSys translation map and broke CMake's detection of
the absolute path to a build directory containing a symbolic link.
Add our own `cmSystemTools::GetCurrentWorkingDirectory` wrapper around
the KWSys method in order to restore that mapping.

Test-case-by: Ben Boeckel <ben.boeckel@kitware.com>
Issue: #16228
Fixes: #20900
2020-07-02 07:33:16 -04:00
Brad King
0fddcc1e5b cmake: Tolerate nullptr from uv_default_loop
`uv_default_loop()` can return `nullptr` when running on a Linux kernel
configured without `CONFIG_EVENTFD`.

Fixes: #20899
2020-07-01 16:26:44 -04:00
Marc Chevrier
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
Brad King
f0a27e44f3 Merge topic 'parallel-lzma-compression'
b3bacf0152 cmCPackArchiveGenerator: support multithreaded compression
b71d385ed4 cmCPackArchiveGenerator: support setting archive options
948aa8bd1c cmArchiveWrite: support setting archive filter options
b9c17de023 cmArchiveWrite: split out opening the file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Merge-request: !3195
2020-04-06 08:28:19 -04:00
Ben Boeckel
b9c17de023 cmArchiveWrite: split out opening the file
This allows options to be set before the "header" phase of libarchive's
API.
2020-03-31 11:08:32 -04:00
Brad King
577fc3ef19 Merge topic 'string-prefix'
ec7928ef26 use _s to construct static string_views at several places
94de927cab VS10Generator: avoid many string allocations
8ca2504a4d use string_views to avoid memory allocations
761f1adcae check for a valid URL scheme before starting to do any splitting
ef778d77e0 replace std::string::substr() with operations that do not allocate memory
77616f4681 pass cm::string_view to cmVisualStudioSlnParser::ParseTag()
ada6a3226f use cm::string_view for language extension lookups
48adc29721 replace "std::string::find(x) == 0" with cmHasPrefix()
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4501
2020-03-26 09:15:41 -04:00
Rolf Eike Beer
bfb69f9543 replace "substr(0, xx) ==" with cmHasPrefix() 2020-03-23 20:19:26 +01:00