1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-12 08:42:47 +08:00

642 Commits

Author SHA1 Message Date
Ben Boeckel
1f893e5873 clang-tidy: fix modernize-loop-convert lints 2022-11-29 12:39:45 -05:00
Ben Boeckel
362d6cd234 clang-tidy: fix modernize-raw-string-literal lints 2022-11-29 12:39:45 -05:00
Ben Boeckel
27f5ce07cc clang-tidy: fix performance-unnecessary-value-param lints 2022-11-29 12:39:45 -05:00
Ben Boeckel
b72c45e39f clang-tidy: fix readability-else-after-return lints 2022-11-29 12:39:29 -05:00
Ben Boeckel
07172aa31e clang-tidy: fix readability-redundant-string-cstr lints 2022-11-29 12:39:29 -05:00
Ben Boeckel
c61ece5c40 clang-tidy: fix modernize-use-auto lints 2022-11-29 12:39:29 -05:00
Ben Boeckel
1b929ba8e4 clang-tidy: fix modernize-use-nullptr lints 2022-11-29 12:39:29 -05:00
Ben Boeckel
860adec528 clang-tidy: fix modernize-pass-by-value lints 2022-11-29 12:39:29 -05:00
Ben Boeckel
27e37b8a5a clang-tidy: fix modernize-use-override lints 2022-11-29 12:39:29 -05:00
Ben Boeckel
f8a2926986 clang-tidy: fix modernize-use-default-member-init lints 2022-11-29 12:39:29 -05:00
Peter Würth
60a5a39022 cmCustomCommandGenerator: refactor GetComment to return std::string
Refactoring was done because EvaluateComment leaked memory.
2022-11-19 13:32:56 +01:00
Ilia K
3166547cf6 ASM_MARMASM: Add support for Microsoft ARM assembler language
https://learn.microsoft.com/en-us/cpp/assembler/arm/arm-assembler-reference

Fixes: #23999
2022-11-09 10:22:46 -05:00
Brad King
8d6f015d59 Drop Visual Studio 10 2010 generator
This generator has been deprecated since CMake 3.22.  Remove it.
2022-09-26 15:43:04 -04:00
Robert Maynard
96bc59b1ca CUDA: Add Device LTO support for nvcc
Fixes #22200
2022-07-22 10:34:45 -04:00
Marc Chevrier
42965799b4 Genex: Add $<LINK_LIBRARY:...>
This generator expression offers the capability, for the link step, to
decorate libraries with prefix/suffix flags and/or adding any specific flag for each
library.

Fixes: #22812, #18751, #20078, #22703
2022-02-08 00:02:32 +01:00
Sumit Bhardwaj
a88f98b3be Make cmGlobalVisualStudioGenerator::VSVersion enum class 2022-01-25 11:25:18 -08:00
Sumit Bhardwaj
3b7520b94d Consolidate usage of VsProjectType
Move ProjectFileExtension handling logic to use ProjectType and remove
extraneous checks in .Net SDK style project generation. This change will
make introducing new project types relatively simpler.
2021-12-23 15:53:04 -08:00
Sumit Bhardwaj
aca153b104 VS: Add custom VCEnd labels only in C# projects
In commit dff98aa9ca (VS: add missing label in C# project-build events,
2021-12-15) the condition for adding our own `VCEnd` label was based on
the project being managed or not.  Since we support managed C++
projects, switch the condition to be based on whether the project is C#.

Issue: #21440
2021-12-16 15:31:14 -05:00
Brad King
d71425f989 Merge topic 'vs-csproj-scripts'
dff98aa9ca VS: add missing label in C# project-build events

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6801
2021-12-16 10:36:56 -05:00
Steven Boswell
dff98aa9ca VS: add missing label in C# project-build events 2021-12-15 11:11:48 -07:00
NAKAMURA Takumi
780341f360 cmCustomCommand: Track main dependency explicitly
Store the main dependency as the first entry in the dependency list plus
a boolean member indicating its existence.  Note that this slightly
changes existing behavior: the main dependency was previously the last
entry of the dependency list.
2021-12-14 10:48:43 -05:00
Brad King
9ecb24b5a7 Merge topic 'vs-csproj-scripts'
13a7ae2194 VS: Revert "Add missing label in C# project-build events"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6781
2021-12-03 08:54:34 -05:00
Brad King
13a7ae2194 VS: Revert "Add missing label in C# project-build events"
Revert commit b284a21fee (VS: Add missing label in C# project-build
events, 2021-09-03, v3.22.0-rc1~156^2).  The change broke cases using
multiple successful custom commands.  Revert it pending further
investigation into the interaction of the generated script code with
`Microsoft.Common.CurrentVersion.targets`, and whether this is needed
for all managed projects or just C# projects.

Also add a test covering the case that was broken.

Fixes: #22964
Issue: #21440
2021-12-02 18:06:39 -05:00
NAKAMURA Takumi
0e58a5ea07 Source: Fix possible IWYU warnings in Windows generators 2021-11-20 00:50:33 +09:00
NAKAMURA Takumi
c46b041a3b cmLocalGenerator: Simplify Add{Custom,Utility}Command 2021-11-18 12:02:38 -05:00
Rose
6f4727aaa0 Source: Replace C headers with C++ ones
In applicable areas only, of course.
2021-11-02 14:45:29 -04:00
Luigi Fiorentini
a2b782bbc1 VS: Map /Y- flag to not use precompiled headers with VS 2008 2021-09-22 09:19:47 -04:00
Marc Chevrier
cc56dc7468 Rename cmProp in cmValue 2021-09-21 17:14:04 +02:00
Marc Chevrier
9488f8a7b7 Merge topic 'enh-AddCacheEntry-accepts-new-types'
f84193292c Use new AddCacheEntry signatures
3c2e58eeb8 AddCacheEntry accept cmProp or std::string

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6495
2021-09-10 09:47:39 -04:00
Marc Chevrier
f84193292c Use new AddCacheEntry signatures 2021-09-10 15:46:21 +02:00
Steven Boswell
b284a21fee VS: Add missing label in C# project-build events
Fixes: #21440
2021-09-09 14:22:26 -04:00
Brad King
8a4ca110e4 cmComputeLinkInformation: Improve type safety of item IsPath member
Use an enum to avoid implicit conversions to bool.
2021-05-29 09:28:35 -04:00
Brad King
15fa320071 cmLocalGenerator: Factor out relative path conversion helpers
Most calls to `MaybeConvertToRelativePath` use one of our common work
directories (e.g. top of the build tree) as the local path.  Add helpers
for each of the common cases to simplify and clarify call sites.
2021-05-13 12:47:25 -04:00
Vitaly Stakhovsky
ce97b7909b Source: Remove unnecessary comparisons to nullptr 2021-05-10 11:44:53 -04:00
Kyle Edwards
f01f10e8fb cmCustomCommand: Record value of CMP0116 at time of creation 2021-02-23 09:14:31 -05:00
Cristian Adam
c450d66daa PCH: Remove restrictions for REUSE_FROM signature for MSVC
Fixes: #20201
2021-02-02 15:03:55 -05:00
Brad King
8d379e7406 Revert "PCH: Remove restrictions for REUSE_FROM signature for MSVC"
This reverts commit 9f060971411aca979807f70307d8b9fe1b43ff24.
It was merged accidentally.
2021-02-02 15:02:08 -05:00
Cristian Adam
9f06097141 PCH: Remove restrictions for REUSE_FROM signature for MSVC
Fixes: #20201
2021-02-02 19:11:44 +01:00
Volker Jacht
8ad6fabfc5 VS: Remove flag table entries for Fortran /Z* flags
These were included when the Fortran flag table was first created by
commit 10c91ded4f (ENH: add support for Intel Fortran Visual studio IDE,
2008-04-30, v2.8.0~2227), but they map to fields not actually supported
by the IDE.  Remove their table entries.

Instead use just `/debug:minimal` and `/debug:full` to control debug
information level in VS Intel Fortran.  Let flags like `/Z7` pass
through as raw additional options because they have no corresponding IDE
property and can be used to complement the supported options.

Fixes: #21340
2020-10-22 09:08:52 -04:00
Brad King
436b57ccb2 Merge topic 'genexpr-for-mfc-flag'
c1f1eaf7a4 VS: Teach CMAKE_MFC_FLAG to support generator expressions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5283
2020-10-01 07:59:33 -04:00
Andrey Starodubtsev
c1f1eaf7a4 VS: Teach CMAKE_MFC_FLAG to support generator expressions 2020-09-30 12:24:13 -04:00
Mark Jansen
7bda9a7fc7 VS: Make ImportLibary generation optional
Fixes: #21180
2020-09-30 12:11:54 -04:00
Brad King
066f4d0f0a VS: Avoid unnecessary duplication of custom commands across targets in VS 9
Do not attach a custom command to a target if it is already attached to one of
the target's dependencies.  The command's output will be available by the time
the target needs it because the dependency containing the command will have
already been built.

The same change was already made by commit f59c33a763 (VS: Generate a
custom command only in the least dependent target, 2018-03-23,
v3.12.0-rc1~171^2) for VS 10+.
2020-09-08 14:52:22 -04:00
Brad King
8bb5c96bf8 cmLocalVisualStudio7Generator: Adopt SourcesVisited lookup table
Move it up the hierarchy from `cmLocalVisualStudio10Generator`.
Propagate contents from a target's dependencies as part of the main
target iteration logic instead of as part of the generator-specific
target generation.
2020-09-08 14:52:22 -04:00
Brad King
aea465793e cmLocalVisualStudio7Generator: Consolidate target iteration
Combine iteration with `cmLocalVisualStudio10Generator` and dispatch
generation of each target with a virtual `GenerateTarget` method.
2020-09-04 09:44:30 -04:00
Brad King
48bf7192e7 cmLocalVisualStudio7Generator: Generate targets in dependency order
Use the globally computed target ordering so that we generate all
of a target's dependencies before generating the target itself.
2020-09-04 09:44:30 -04:00
Vitaly Stakhovsky
11425041f0 cmMakefile::GetDefinition: return cmProp 2020-09-02 07:27:32 -04:00
Kyle Edwards
3ef0c40962 WIN32_EXECUTABLE: Add support for generator expressions 2020-08-21 09:17:27 -04:00
Brad King
4391913133 Add INTERFACE libraries to generated buildsystem if they have SOURCES
INTERFACE libraries were created with the intention of collecting usage
requirements for use by other targets via `target_link_libraries`.
Therefore they were not allowed to have SOURCES and were not included in
the generated buildsystem.  In practice, this has become limiting:

* Header-only libraries do have sources, they just do not compile.
  Developers should be able to edit those sources (the header files)
  in their IDE.

* Header-only libraries may need to generate some of their header
  files via custom commands.

Some projects work around these limitations by pairing each interface
library with an `add_custom_target` that makes the header files and
custom commands appear in the generated buildsystem and in IDEs.

Lift such limitations by allowing INTERFACE libraries to have SOURCES.
For those with sources, add a corresponding build target to the
generated buildsystem.

Fixes: #19145
2020-08-07 08:46:32 -04:00
Brad King
422d9a0ab2 Factor out generator checks for filtering out interface libraries
Add a `cmGeneratorTarget::IsInBuildSystem` helper method to tell
generators whether a target should participate in the generated build
system.
2020-07-23 13:31:44 -04:00