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

611 Commits

Author SHA1 Message Date
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
Robert Maynard
7a969fe21d cmMakefile: Refactor API to better handle empty config values 2020-07-03 07:43:18 -04:00
Brad King
62816ff88c Merge topic 'fortran-preprocess-property'
3888de23da Ninja: Skip Fortran preprocessing if Fortran_PREPROCESS is OFF
66c4e87282 Ninja: Add helper functions to generate Fortran build
5cca1ec893 Ninja: Add helper functions to generate Fortran preprocess rule
b0a6161190 Fortran: Add Fortran_PREPROCESS property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4659
2020-05-22 10:35:10 -04:00
Peter Hill
b0a6161190 Fortran: Add Fortran_PREPROCESS property
Issue: #18870
2020-05-21 11:44:14 -04:00
Marc Chevrier
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
Vitaly Stakhovsky
36aba01223 cmGeneratorTarget::GetProperty: return cmProp 2020-04-29 10:59:39 -04:00
Vitaly Stakhovsky
4fd28b9911 cmOutputConverter::GetFortranFormat(): delete const char* overload 2020-04-27 07:38:47 -04:00
Marc Chevrier
aacd4e4a90 Refactoring: add cm::contains to <cmext/algorithm> 2020-04-17 10:00:03 +02:00
Brad King
156196938c Merge topic 'cmprop-source'
e64fa5f1b6 cmSourceFile::GetProperty: return cmProp
fc223f9860 cmGlobalXCodeGenerator: Fix genex interpreter overloads

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4603
2020-04-15 09:49:46 -04:00
Vitaly Stakhovsky
e64fa5f1b6 cmSourceFile::GetProperty: return cmProp 2020-04-14 10:57:17 -04:00
Justin Goshi
bc877a7e94 Add support to indicate UTF-8 custom command pipe output encoding
Adds a flag to indicate that pipe output from a custom command should be
interpreted as UTF-8 encoded. This change does not introduce a public
way to set the flag, but generators that create internally-generated
commands know if they are calling cmake, which uses UTF-8 pipes.

MSBuild added support for interpreting output of PreBuildEvent,
PreLinkEvent, PostBuildEvent, and CustomBuildStep as UTF-8. This change
will appear in Visual Studio 16.6 Preview 3. It is opt-in, and you need
to add the StdOutEncoding tag. MSBuild treats these as property bags so
if we emit the tag for earlier versions of Visual Studio it would be
safely ignored. This change emits the StdOutEncoding tag and sets it to
UTF-8 whenever the custom command UTF-8 pipe flag is set. This fixes
globalization issues when the output from cmake contained characters
that required MSBuild to interpret as UTF-8 before displaying them.
2020-04-13 12:54:47 -07:00
Brad King
25a920e827 cmLocalGenerator: Convert GetStaticLibraryFlags to take original-case config
Move upper-case conversion of the configuration into the implementation.
2020-04-01 10:55:59 -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
Brad King
12b39aef75 Remove redundant calls to CollapseFullPath
Remove calls where it is known the input is already a collapsed
full path.
2020-03-24 10:10:06 -04:00
Rolf Eike Beer
48adc29721 replace "std::string::find(x) == 0" with cmHasPrefix() 2020-03-23 22:41:43 +01:00
Vitaly Stakhovsky
cbbca9ee2a Convert more loops to range-based for-loops 2020-03-10 14:25:56 -04:00
Marc Chevrier
9de0355d4f Modernize memory management
Update internals of various classes.
2020-03-05 07:34:01 -05:00
Brad King
8752c1bd64 Merge branch 'backport-3.16-link-line-backtrace' 2020-02-10 16:17:03 -05:00
Brad King
e756328434 Propagate backtraces from LINK_LIBRARIES through to link line items
Since commit d4d0dd0f6a (cmLinkLineComputer: Add ComputeLinkLibs
overload with backtraces, 2019-09-13, v3.16.0-rc1~87^2~4), backtraces
have been collected by `ComputeLinkLibs` by looking back through the
link implementation libraries for one matching the text of the link line
item.  This is slow in projects with long link lines.

Instead, teach `cmComputeLinkDepends` and `cmComputeLinkInformation` to
carry backtrace information explicitly along with the text of each item.

Fixes: #20322
2020-02-10 16:11:38 -05:00
Vitaly Stakhovsky
2e768924f3 cmLocalVisualStudio7Generator: clean up c_str() 2020-01-20 15:44:07 -05:00
Brad King
c42ade942d Merge topic 'vs-Fortran-link-flags'
a3c827b2ea VS: Add Fortran link flag table entries for /OPT:*

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4210
2020-01-14 09:01:21 -05:00
Pavel Liavonau
a3c827b2ea VS: Add Fortran link flag table entries for /OPT:*
Fixes: #20190
2020-01-13 11:14:00 -05:00
Vitaly Stakhovsky
c34b4497f8 cmTarget: add std::string overloads 2019-12-14 09:30:28 -05:00
Daniel Eiband
777ceaea94 cmMakefile: Delay custom command creation
Move custom command creation to cmLocalGenerator and dispatch custom
commands in cmMakefile to generate time.  Generators add custom commands
using the new methods provided by cmLocalGenerator.

Issue: #12877
2019-11-24 20:32:43 +01:00
Brad King
cad199d4b2 Merge topic 'tag-std-string'
64843b1737 cmVisualStudio10TargetGenerator: use std::string for tag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4026
2019-11-13 09:42:02 -05:00
Marc Chevrier
f93385283f cmLocalGenerator: modernize memory management 2019-11-11 16:41:13 +01:00
Vitaly Stakhovsky
64843b1737 cmVisualStudio10TargetGenerator: use std::string for tag 2019-11-10 09:29:27 -05:00
Brad King
fd2c9fac10 cmGeneratorTarget: Return non-const sources from GetAllConfigSources
We need a non-const pointer to `cmSourceFile` instances in order to
call `GetOrDetermineLanguage` on them.
2019-10-17 14:03:54 -04:00
Brad King
bab7ec3c25 Merge topic 'pch-generate'
36ded610af PCH: Generate sources during Compute step

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3890
2019-10-10 09:22:39 -04:00
Brad King
e5419f4f87 Merge branch 'pch-generate' into release-3.16
Merge-request: !3890
2019-10-10 09:14:58 -04:00
Cristian Adam
36ded610af PCH: Generate sources during Compute step 2019-10-09 13:50:25 +02:00
Brad King
04e5f30ad3 VS: Tell VS 16.4 not to verify CMake-provided custom command outputs
Extend the fix from commit 0578239d3a (VS: Tell VS 16.4 not to verify
SYMBOLIC custom command outputs, 2019-09-23, v3.15.4~2^2) to apply to
outputs in CMake-provided targets like `install`.  Simply mark these
outputs as `SYMBOLIC` too since they are not actually generated.

Fixes: #19737
2019-10-07 17:41:31 -04:00