Commit Graph

33558 Commits

Author SHA1 Message Date
Kitware Robot b96d7418b7 CMake Nightly Date Stamp 2023-01-30 00:01:22 -05:00
Kitware Robot a5e272c76f CMake Nightly Date Stamp 2023-01-29 00:01:14 -05:00
Kitware Robot 3955e045fc CMake Nightly Date Stamp 2023-01-28 00:01:10 -05:00
Brad King 77074c3eb5 Merge topic 'vs-asm-flags'
24bcad5bac VS: Honor compile options for ASM_NASM
b44714a642 VS: Honor compile options for ASM_MARMASM

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8125
2023-01-27 10:29:44 -05:00
Brad King eabc3c64e8 Merge topic 'jmalak-master-patch-responsefile'
a6bdf54a5e Watcom: Fix double-quote to be single-quote in response files for wlink

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8119
2023-01-27 10:27:27 -05:00
Kitware Robot a50b278512 CMake Nightly Date Stamp 2023-01-27 00:01:12 -05:00
Brad King 24bcad5bac VS: Honor compile options for ASM_NASM
The Ninja and Makefile generators honor `target_compile_options` and
friends for ASM_NASM `.asm` sources.  Teach the VS generator to
honor them too for consistency.

Issue: #24289
2023-01-26 13:51:49 -05:00
Brad King b44714a642 VS: Honor compile options for ASM_MARMASM
The Ninja and Makefile generators honor `target_compile_options` and
friends for ASM_MARMMASM `.asm` sources.  Teach the VS generator to
honor them too for consistency.

Issue: #24289
2023-01-26 12:56:25 -05:00
Jiri Malak a6bdf54a5e Watcom: Fix double-quote to be single-quote in response files for wlink
Response files contained double-quote for any response file, but response files for wlink must contains single-quote. This is fix for libraries list response file. Problem for object file list was fixed by MR
!8115
2023-01-26 15:27:53 +01:00
Brad King 6dca2dd86d Merge topic 'xcode-swift-inherited-flags'
01c1d81527 Xcode: Inherit Swift flags and compilation conditions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8122
2023-01-26 09:15:57 -05:00
Brad King 1f97d068ac Merge topic 'jmalak-master-patch-watcomquote'
a1d065e5c7 Watcom: Replace WATCOMQUOTE format by UseWatcomQuote attribute

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8115
2023-01-26 09:12:14 -05:00
Brad King eb130c0864 Merge topic 'vs-BuildInParallel'
8024c41685 VS: Do not concurrently build custom commands with generated MAIN_DEPENDENCY

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8120
2023-01-26 09:11:08 -05:00
Kitware Robot 3c9766d3a2 CMake Nightly Date Stamp 2023-01-26 00:01:10 -05:00
Ross Kilgariff 01c1d81527 Xcode: Inherit Swift flags and compilation conditions
Extend the change from commit dfaf55fbfd (Xcode: add extra
'$(inherited)' entries using InheritBuildSettingAttribute, 2021-05-03,
v3.21.0-rc1~182^2) to cover Swift flags and compilation conditions,
allowing CocoaPods and CMake to interoperate when used in the same
project.
2023-01-25 15:15:03 -05:00
Brad King 3c8a65d3aa Merge topic 'swiftmodule-dependency-tracking'
1730d208b5 Add incremental Swift static lib build test
bf3a8ef6d5 Ninja: Swift: Add dependency edge to swiftmodule file
d0b469b7e0 Ninja: NFC: refactor swift module name computations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8084
2023-01-25 11:11:37 -05:00
Brad King 8024c41685 VS: Do not concurrently build custom commands with generated MAIN_DEPENDENCY
Since commit 33c15ae2b9 (VS: Build custom commands concurrently when
possible, 2023-01-19) several tests have failed intermittently with the
VS generator.  It seems that if the `BuildInParallel` setting is
attached to a generated input:

    <CustomBuild Include="generated_input.txt">
      <BuildInParallel Condition="...">true</BuildInParallel>
      <Command Condition="...">copy geneated_input.txt output.txt</Command>
      ...
    </CustomBuild>

then MSBuild does not wait for the input to be generated before running
the command.

This occurs when using `add_custom_command`'s `MAIN_DEPENDENCY`, so
avoid using `BuildInParallel` in that case.

Issue: #18405
2023-01-25 10:59:44 -05:00
Kitware Robot 7a989a581c CMake Nightly Date Stamp 2023-01-25 00:01:15 -05:00
Jiri Malak a1d065e5c7 Watcom: Replace WATCOMQUOTE format by UseWatcomQuote attribute
Replace WATCOMQUOTE output format by UseWatcomQuote attribute to properly handle single quote
This attribute is used globaly only for Watcom linker to handle single-quote separator instead of double-quote
it doesn't mean different output format only change of quoting separator
It is now applied to any output form SHELL/RESPONSE/NINJAMULTI if Watcom linker is used otherwise double-quote is used
2023-01-24 22:12:28 +01:00
Brad King 07206384ec Merge topic 'cxxmodules-ninja-1.11'
8d4e510a44 Merge branch 'backport-cxxmodules-ninja-1.11' into cxxmodules-ninja-1.11
7abddcab08 Ninja: require Ninja 1.11 for C++ module support
0512428ad9 Ninja: require Ninja 1.11 for C++ module support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8099
2023-01-24 09:18:20 -05:00
Kitware Robot ec381070fa CMake Nightly Date Stamp 2023-01-24 00:01:13 -05:00
Ben Boeckel 7abddcab08 Ninja: require Ninja 1.11 for C++ module support
See: https://gitlab.kitware.com/cmake/cmake/-/issues/18355#note_1296721
See: https://github.com/ninja-build/ninja/pull/1937
2023-01-23 12:21:05 -05:00
Brad King 709bc0368f Merge topic 'genex-CONFIG-validate-all'
910ada1a88 Genex: $<CONFIG:> syntax of all entries checked
42e417ad12 GeneratorExpression Tests: Remove duplicate test entry

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8082
2023-01-23 10:40:53 -05:00
Brad King 99bd5eb062 Merge topic 'vs-BuildInParallel'
33c15ae2b9 VS: Build custom commands concurrently when possible

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8093
2023-01-23 10:39:09 -05:00
Ivan Zinkevich 33c15ae2b9 VS: Build custom commands concurrently when possible
Enable the `BuildInParallel` setting in VS project files when supported.

Fixes: #18405
2023-01-23 10:38:07 -05:00
Brad King f4d604f77f Merge topic 'try_compile-verbose'
faa950a155 try_compile: Run native build tool with verbose output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8095
2023-01-23 10:34:37 -05:00
Kitware Robot adac7f3ca4 CMake Nightly Date Stamp 2023-01-23 00:01:17 -05:00
Kitware Robot 6d57bbdc7b CMake Nightly Date Stamp 2023-01-22 00:01:08 -05:00
Evan Wilde bf3a8ef6d5 Ninja: Swift: Add dependency edge to swiftmodule file
Swiftmodules act like headers for Swift, but are generated by the
compiler while building the module. Unlike headerfiles in a pure C/C++
world, where the compiler generates the appropriate depfile. We don't
have We're
already adding the swiftmodule as an output from swift-linked targets,
but aren't using that on inputs.

This dependency edge is most important for static libraries in
incremental builds. Suppose we have two static libraries, A, and B, and
an executable E. B "links" against A, and E links against B. In a C/C++
environment, the library link dependency edge will run from E to both A
and B, but there won't be an edge from B to A. If A is changed, the only
way this should affect B is if the public interface changes, in which
case, the headers will also change. The dep file contains the header
link, so Ninja will rebuild B when appropriate. With Swift in an
incremental build, B sees the order-dependency on A, but A already
exists. If A is changed in a way that changes the public interface, the
swiftmodule will change, but since we don't track it, we don't rebuild
B, resulting in the final executable to fail to link.
2023-01-21 10:37:09 -08:00
Evan Wilde d0b469b7e0 Ninja: NFC: refactor swift module name computations
In order to handle determining the swiftmodule name to add to the ninja
dependency graph, we'll need to be able to compute the swiftmodule name
for the dependency target, not just the current target. This patch
refactors the computation of the module name out of inaccessible lambdas
and into static functions that can compute the swiftmodule name from the
generator and the target.
2023-01-21 10:37:09 -08:00
Kitware Robot 09ce97c40d CMake Nightly Date Stamp 2023-01-21 00:01:11 -05:00
Robert Maynard 910ada1a88 Genex: $<CONFIG:> syntax of all entries checked
Fixes #24327
2023-01-20 13:30:25 -05:00
Brad King 06c7e88b91 Merge topic 'configure-log'
317aac14ef cmake: Stop pointing users at logs on configure errors
eae1398d09 cmake --system-information: Stop dumping CMake{Output,Error}.log

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8094
2023-01-20 09:37:08 -05:00
Brad King 1d52007564 Merge topic 'ninja-swift-exported-executables'
4165eb3d0b Ninja: Emit swiftmodule from executable with exports

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8048
2023-01-20 09:36:00 -05:00
Brad King 8150831dfd Merge topic 'cygwin-no-legacy-win32'
a429e4b9b1 CYGWIN: Drop pre-2.8.4 compatibility mode CMAKE_LEGACY_CYGWIN_WIN32

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8096
2023-01-20 09:33:34 -05:00
Brad King 526b2db5d3 Merge topic 'print-configure-generate-time'
5f0c5ec49b cmake: Print configure/generate time

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !8083
2023-01-20 09:32:45 -05:00
Brad King dde39a820e Merge topic 'update-kwsys'
dae189fb09 Merge branch 'upstream-KWSys' into update-kwsys
4ac17cff42 KWSys 2023-01-19 (be3c441e)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8092
2023-01-20 09:29:52 -05:00
Brad King faa950a155 try_compile: Run native build tool with verbose output
Make the compiler command lines visible in the configure log.

Issue: #23200
2023-01-20 09:17:51 -05:00
Kitware Robot 50dd0c4bfb CMake Nightly Date Stamp 2023-01-20 00:01:12 -05:00
Evan Wilde 4165eb3d0b Ninja: Emit swiftmodule from executable with exports
This patch adds support for tracking the swiftmodules for executables
exporting symbols.

This fixes a bug in the earlier implementation around emitting the
swiftmodule. Previously, the code would use
`CMAKE_EXE_EXPORTS_Swift_FLAG` to inject the `-emit-module`, and module
path information into the `CMAKE_Swift_LINK_EXECUTABLE` rule. Because
Swift skips the build step and only runs during the link phase, these
flags were injected in `cmNinjaNormalTargetGenerator::ComputeLinkCmd`
instead of `cmLocalGenerator::GetTargetFlags` where it is done normally.

Unfortunately, injecting in `ComputeLinkCmd` didn't do anything because
we have a `linkCmd` so `ComputeLinkCmd` exits early, before the
EXE_EXPORT flags get added to the link command.

Instead of playing with that flag, CMake checks
`CMAKE_Swift_LINK_EXECUTABLE_WITH_EXPORTS` and uses that as the link
rule if it exists and falls back on `CMAKE_Swift_LINK_EXECUTABLE`. I've
defined that variable in terms of `CMAKE_Swift_LINK_EXECUTABLE` with the
necessary additional flags for emitting the swift module instead. This
has the same end effect as the desired behavior, but simplifies things a
bit.

Since we're generating the swiftmodule for executables with exports,
I've also updated the dependency graph to include the swiftmodule as an
output in the build dependency graph if the executable has exports.

Tests updated:
 - RunCMake/NoWorkToDo:
   Ensure that the build graph does not result in unnecessary rebuilds
   with exporting executables.

 - SwiftOnly:
   Ensure that we can consume functions defined in the executable by a
   library getting linked into said executable.
2023-01-19 11:49:24 -08:00
Brad King a429e4b9b1 CYGWIN: Drop pre-2.8.4 compatibility mode CMAKE_LEGACY_CYGWIN_WIN32
Prior to CMake 2.8.4 (released in 2011), we defined `WIN32` on CYGWIN.
That was removed, but an undocumented `CMAKE_LEGACY_CYGWIN_WIN32`
compatibility mode was left to help projects transition.  Only projects
that do not require at least 2.8.4 as their minimum CMake version need
the compatibility mode.  We've also long warned about projects that do
not require at least 2.8.12, so it is now reasonable to remove the
legacy compatibility mode.
2023-01-19 14:29:35 -05:00
Brad King 317aac14ef cmake: Stop pointing users at logs on configure errors
Since commit 18e1bfbb3c (cmake: On configure error suggest looking at
CMake*.log files, 2013-07-09, v2.8.12~210^2), when configuring a project
fails, we print `See also .../CMake{Output,Error}.log` near the end of
the output.  This was intended to help users find failures in system and
compiler inspection checks, but for normal project errors the messages
may be misleading.  The logs may contain incidental errors that are part
of normal operation and do not need to be addressed by the user.

Since commit f6ed2585e5 (Modules: Record system inspection steps in the
configure log, 2023-01-16), CMake's builtin modules no longer log
information to the old-style `CMake{Output,Error}.log` files anyway,
so stop mentioning them.

Fixes: #22131
Issue: #23200
2023-01-19 13:27:51 -05:00
Kyle Edwards 5f0c5ec49b cmake: Print configure/generate time 2023-01-19 09:51:07 -05:00
Brad King 28fd87aa1d Merge topic 'optimize-target-depends-closure'
1f16af01f4 cmGlobalNinjaGenerator: Optimize target depends closure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8079
2023-01-19 09:22:05 -05:00
Brad King cd87bebe49 Merge topic 'optimize-full-name-function'
a525f5f1bf cmGeneratorTarget: Cache full name components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8033
2023-01-19 09:21:18 -05:00
Brad King dae189fb09 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2023-01-19 (be3c441e)
2023-01-19 09:17:35 -05:00
Brad King d6d847607c Merge topic 'clang-format-15'
33abef7416 Revise C++ coding style using clang-format-15
57221fd56f Empty commit at end of history preceding clang-format-15 style transition
6739d57948 clang-format.bash: update to clang-format-15
9ee57226bc clang-format: Add comments to suppress some formatting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8086
2023-01-19 09:07:18 -05:00
Kitware Robot 4c5efdcfa8 CMake Nightly Date Stamp 2023-01-19 00:01:11 -05:00
Kitware Robot 33abef7416 Revise C++ coding style using clang-format-15
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 15.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Fixes: #24315
2023-01-18 16:20:47 -05:00
Brad King 9ee57226bc clang-format: Add comments to suppress some formatting
Preserve manually-formatted blocks.
2023-01-18 16:19:27 -05:00
Brad King 20bbd5f3d3 Merge topic 'configure-log'
a78cba5197 message: Add CONFIGURE_LOG mode to record a message in the configure log
645671d36f Help: Document configure log behavior in try_compile and try_run

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8080
2023-01-18 12:43:19 -05:00