Commit Graph

33099 Commits

Author SHA1 Message Date
Brad King
183b9a9eca CMP0141: Fix PCH REUSE_FROM under policy NEW behavior
Under the CMP0141 NEW behavior added by commit 0e96a20478 (MSVC: Add
abstraction for debug information format, 2022-08-25, v3.25.0-rc1~142^2~1),
the `-Zi` and `-ZI` flags do not appear in `CMAKE_<LANG>_FLAGS_<CONFIG>`
anymore.  Teach the PCH REUSE_FROM implementation to recognize the
`EditAndContinue` and `ProgramDatabase` debug information formats
through the policy's new abstraction.

Fixes: #24106
2022-10-31 12:19:06 -04:00
Brad King
2e65fe92db cmLocalGenerator: Clarify name of local PDB type variable 2022-10-31 12:16:54 -04:00
Brad King
17096aeba8 cmLocalGenerator: Factor out helper to compute MSVC_DEBUG_INFORMATION_FORMAT 2022-10-31 12:16:45 -04:00
Brad King
c8f3ba7214 Merge topic 'file-download-log-with-hash' into release-3.25
d78671879b file(DOWNLOAD): Fix LOG with EXPECTED_HASH on download failure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7848
2022-10-31 09:47:18 -04:00
Brad King
d69b77a9ca Merge topic 'ninja-showIncludes-encoding' into release-3.25
a0d4e3bf34 cmGeneratedFileStream: Drop unused WriteRaw method
2e5af30ce0 Ninja: Match showIncludes dependencies using console output code page
e1c1679148 cm_codecvt: Add support for the Windows console output code page
328c15189d cmGeneratedFileStream: Add support for a temporary alternate encoding

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7845
2022-10-31 09:44:11 -04:00
Aurelien Regat-Barrel
d78671879b file(DOWNLOAD): Fix LOG with EXPECTED_HASH on download failure
When `file(DOWNLOAD <url> EXPECTED_HASH <hash> LOG <logs>)` fails to
download the requested file, the hash check will also fail and make the
command exit without actually returning the curl logs as requested
by the `LOG` argument.  Report the log before checking the hash.

Issue: #24093
2022-10-30 08:42:19 -04:00
Brad King
a0d4e3bf34 cmGeneratedFileStream: Drop unused WriteRaw method
It has been superseded by `WriteAltEncoding`.
2022-10-30 08:31:35 -04:00
Brad King
2e5af30ce0 Ninja: Match showIncludes dependencies using console output code page
Generalize the fix from commit 37a279f8d1 (Ninja: Write msvc_deps_prefix
as UTF-8 when console codepage is UTF-8, 2020-07-31, v3.19.0-rc1~349^2).
`cl /showIncludes` output is encoded using the console output code page,
so this is the byte sequence that Ninja must use to match its lines.

Fixes: #24068
2022-10-30 08:29:55 -04:00
Brad King
e1c1679148 cm_codecvt: Add support for the Windows console output code page
This is distinct from the Windows ANSI code page.
2022-10-28 20:23:25 -04:00
Brad King
328c15189d cmGeneratedFileStream: Add support for a temporary alternate encoding
The Ninja generator needs to be able to write some file content in a
different encoding than the rest of the file.  Add a method to do this.
2022-10-28 20:23:25 -04:00
Brad King
024e3d2bf6 Xcode: Put object files in a place that Xcode cleans
Since commit dc5fc898f6 (Xcode: Set object file locations using
TARGET_TEMP_DIR, 2022-09-29, v3.25.0-rc1~64^2~1), `xcodebuild clean`
does not remove the object files in our explicit `TARGET_TEMP_DIR`
because it is not under the `SYMROOT`.  Put it there.

Fixes: #24096
2022-10-28 15:38:07 -04:00
Brad King
4910efb178 Merge topic 'vs-dotnet-sdk-output-paths' into release-3.25
d2d1be0671 VS: Fix paths in multi-target SDK-style projects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7836
2022-10-28 09:58:52 -04:00
Brad King
8d5631f0d0 Xcode: Revert "Don't set INSTALL_PATH unless target is SHARED_LIBRARY"
The change in commit 61acaa12af (xcode: Don't set INSTALL_PATH unless
target is SHARED_LIBRARY, 2022-07-14, v3.25.0-rc1~291^2) breaks some
existing use cases.  Revert it pending further investigation.

Fixes: #24087
Issue: #15183
2022-10-27 10:28:39 -04:00
Sebastian Maisch
d2d1be0671 VS: Fix paths in multi-target SDK-style projects
Set the `AppendTargetFrameworkToOutputPath` property to `false` only for
single target SDK-style projects.  This prevents outputs from being
overwritten during the build.  This revises commit 7671d71299 (VS: Fix
target output paths in SDK-style projects, 2022-09-23, v3.25.0-rc1~82^2).

Fixes: #24094
Issue: #23989
2022-10-27 09:58:09 -04:00
Brad King
33d610a076 Merge topic 'cmake-presets-workflow-arguments' into release-3.25
7ecbe324b0 cmake --workflow: add --fresh option
7d9aa0f00c cmake::Workflow: Refactor to use enum class argument
322193afcd cmake --workflow: print usage and exit on unrecognized argument
70aef29427 cmake --workflow: print usage message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7825
2022-10-27 09:43:38 -04:00
Brad King
7d181917de Merge topic 'xcode-swift-defs' into release-3.25
c0dd3dd2c1 Xcode: Evaluate Swift compile definitions separately

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7826
2022-10-27 09:42:02 -04:00
Brad King
f6034c5f6f Merge topic 'cpack-trace-argument' into release-3.25
b5ebaa0d9c CPack: Require no argument for --trace and --trace-expand

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7824
2022-10-27 09:29:12 -04:00
Brad King
fdabb69e2e Merge topic 'vswhere-support-x86' into release-3.25
6eee8c9000 VS: Fix crash finding vswhere on 32-bit Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7832
2022-10-27 09:28:07 -04:00
Brad King
74057c72d6 Merge topic 'ninja-intl-paths' into release-3.25
a12050666c Tests: Add case for ninja with non-ascii chars
02a04dd9c7 Ninja: Restore support for non-ascii paths on Windows with ninja<=1.10

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7833
2022-10-27 09:26:34 -04:00
Brad King
02a04dd9c7 Ninja: Restore support for non-ascii paths on Windows with ninja<=1.10
Revert commit bbdb000c55 (GlobalNinjaGenerator: enlarge file stream
buffer, 2022-01-25, v3.23.0-rc1~68^2).  Somehow `rdbuf()->pubsetbuf()`
is resetting our imbued locale and `cm_codecvt` that handles encoding.

Fixes: #24089
2022-10-26 15:24:43 -04:00
Kyle Edwards
7ecbe324b0 cmake --workflow: add --fresh option
Fixes: #24073
2022-10-26 12:01:25 -04:00
Kyle Edwards
7d9aa0f00c cmake::Workflow: Refactor to use enum class argument 2022-10-26 12:01:01 -04:00
Kyle Edwards
322193afcd cmake --workflow: print usage and exit on unrecognized argument
Issue: #24073
2022-10-26 12:00:57 -04:00
Brad King
6eee8c9000 VS: Fix crash finding vswhere on 32-bit Windows
Since commit f85913fa08 (VS: Add support for enumerating VS instances
with vswhere, 2022-04-11, v3.24.0-rc1~282^2), if the COM lookup does not
report any VS instances, we fall back to finding vswhere.  However, the
`getenv` call returns nullptr if the `ProgramFiles(x86)` environment
variable is not set.  Update the logic to tolerate not-set environment
variables.  Also check the plain `ProgramFiles` environment variable.

Fixes: #24090
2022-10-26 11:12:46 -04:00
Brad King
c0dd3dd2c1 Xcode: Evaluate Swift compile definitions separately
Xcode has a separate setting for Swift compile definitions, so we can
compute a dedicated value for it.  Therefore we can:

* Support the COMPILE_LANGUAGE generator expression for Swift-specific
  filters.

* Avoid passing the `=value` part of definitions, which Swift does
  not support.

This revises commit 5cb625eb2f (Xcode: Pass compile definitions to
Swift, 2022-06-19, v3.25.0-rc1~493^2) and reverts commit 12c6fec6b4
(Xcode: Drop CMAKE_INTDIR= definition in Swift targets, 2022-09-30,
v3.25.0-rc1~60^2~2), as the latter is no longer needed.

Fixes: #24086
2022-10-25 14:09:28 -04:00
Kyle Edwards
70aef29427 cmake --workflow: print usage message 2022-10-25 10:52:07 -04:00
Kyle Edwards
b5ebaa0d9c CPack: Require no argument for --trace and --trace-expand
This was accidentally broken by commit 87c762d435 (CPack: Use
cmCommandLineArgument instead of cmsys::CommandLineArguments,
2022-04-18, v3.24.0-rc1~258^2).

Fixes: #24085
2022-10-25 10:11:20 -04:00
Brad King
c3f04fe44d Merge topic 'cmake-presets-list-workflow-type' into release-3.25
75cfbef780 cmake: Support --list-presets=workflow

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Tested-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !7816
2022-10-24 12:33:31 -04:00
Werner, Joerg
f3c918ef1b cmGlobalVisualStudioGenerator: Fix compiling as C++20 in VS 2022
Adding missing narrow string conversion.
2022-10-21 11:01:16 -04:00
Kyle Edwards
75cfbef780 cmake: Support --list-presets=workflow
Fixes: #24072
2022-10-21 10:21:21 -04:00
Brad King
d44340115f Merge topic 'filesystem-path-c++03-abi' into release-3.25
ee9805ccd1 cm/filesystem: Fix crash with pre-C++11 std::string GNU ABI in C++17

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7813
2022-10-21 10:06:20 -04:00
Brad King
47063db58d Merge branch 'filesystem-path-c++03-abi' into release-3.24
Merge-request: !7813
2022-10-20 19:03:52 -04:00
Brad King
ee9805ccd1 cm/filesystem: Fix crash with pre-C++11 std::string GNU ABI in C++17
The `remove_filename` and `replace_extension` methods compute an offset
between the whole path in a `std::string` and a part of a path in a
`std::string_view`.  This is done by subtracting their `.data()`
pointers.  However, C++17 adds a non-const `.data()` through which
modification of the string is allowed.  This means the copy-on-write
implementation used by the pre-C++11 std::string GNU ABI must reallocate
if the string has been copied.  Our subtraction then computes an offset
between two different allocations, which is undefined behavior.

The workaround in commit b3ca4f9ad1 (cm/filesystem: Work around crash
when compiled for CYGWIN/MSYS runtime, 2021-04-22, v3.21.0-rc1~271^2~2)
avoided the problem by calling the non-const `.data()` to reallocate
before constructing the `string_view`.  Instead, explicitly call the
const `.data()` method on the string, which does not reallocate.

Fixes: #22090, #23328
2022-10-20 18:31:50 -04:00
Brad King
7d710abc87 CMake 3.25.0-rc2 2022-10-19 11:22:54 -04:00
Brad King
6fa189f716 Merge topic 'cmake-presets-output-junit' into release-3.25
bea4ed5430 CTest: Add support for outputJUnitFile in presets
9270a02003 CMakePresets.json: Add outputJUnitFile to test presets schema
757786bb73 Tests: Add test for outputLogFile in CMakePresets.json
b68c3596e7 CMakePresets.json: Disallow extra properties in test output schema

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !7806
2022-10-19 10:04:29 -04:00
Brad King
86ed35cf63 Merge topic 'mingw-unc' into release-3.25
9777e4c30e MinGW Makefiles: Quote UNC paths on command lines

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7802
2022-10-19 09:59:59 -04:00
Brad King
177c56e3fa Merge topic 'try_compile-CMP0128' into release-3.25
50e90e2828 try_compile: Honor CMP0128 setting in test project

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !7803
2022-10-19 09:57:08 -04:00
Kyle Edwards
bea4ed5430 CTest: Add support for outputJUnitFile in presets
Fixes: #22400
2022-10-18 16:52:23 -04:00
Kyle Edwards
9270a02003 CMakePresets.json: Add outputJUnitFile to test presets schema 2022-10-18 15:41:29 -04:00
Ed Hartley
9777e4c30e MinGW Makefiles: Quote UNC paths on command lines
UNC paths (starting with `\\`) need quotes when generating MinGW
Makefiles to avoid gmake interpreting the first `\` as an escape
character.

Fixes: #24061
2022-10-18 14:30:57 -04:00
Brad King
588c9c4145 Merge branch 'try_compile-CMP0128' into release-3.24
Merge-request: !7803
2022-10-18 14:25:52 -04:00
Brad King
599e49cf9b Merge topic 'revert_nvcc_marking_include_as_system' into release-3.25
d0e52219eb CUDA: Revert "Always mark cuda toolkit as system include"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7798
2022-10-18 13:45:56 -04:00
Brad King
50e90e2828 try_compile: Honor CMP0128 setting in test project
Some projects pass a raw `-std=` flag to the compiler in the
`try_compile` project.  If they do not set CMP0128 to NEW,
we should not append a `-std=` flag where we did not before
the policy was added.

Fixes: #24063
2022-10-18 13:38:00 -04:00
Robert Maynard
d0e52219eb CUDA: Revert "Always mark cuda toolkit as system include"
We need to revert this change as it can disable error messages
when compiling invalid CUDA code.

This reverts commit ea659b155d (CUDA: Always mark cuda toolkit as system
include, 2022-06-27, v3.25.0-rc1~269^2).
2022-10-17 10:17:33 -04:00
Marc Chevrier
4aa86da827 Xcode: ensure framework with custom output directory can be consumed
Fixes: #24046
2022-10-14 09:13:37 -04:00
Brad King
ed084886b7 CMake 3.25.0-rc1 2022-10-12 10:23:58 -04:00
Brad King
5d132113b1 Begin 3.25 release versioning 2022-10-11 11:13:05 -04:00
Kitware Robot
e21071ec4b CMake Nightly Date Stamp 2022-10-11 00:01:15 -04:00
Brad King
4507237960 Merge topic 'verify-header-sets-iwyu'
6942234bf5 VERIFY_INTERFACE_HEADER_SETS: Add IWYU pragma: associated to verification file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7762
2022-10-10 10:21:09 -04:00
Brad King
1fea40c85a Merge topic 'cuda_sanitizer_false_positives'
59fcbba65e ctest_memcheck: ignore false-positives in CUDA's compute-sanitizer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7760
2022-10-10 10:19:56 -04:00