Commit Graph

1387 Commits

Author SHA1 Message Date
Brad King
50b668ddc8 Merge topic 'add_subdirectory_system'
2eb30a7036 add_subdirectory: Add SYSTEM option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7399
2022-09-27 10:28:49 -04:00
Da Quexian
2eb30a7036 add_subdirectory: Add SYSTEM option
Fixes: #22401
Signed-off-by: Da Quexian <daquexian566@gmail.com>
2022-09-26 10:56:54 -04:00
Brad King
c3e68020d6 Merge topic 'MsvcDebugInformationFormatAbstraction'
a858466aac MSVC: Add test for debug information format
0e96a20478 MSVC: Add abstraction for debug information format
d4c8111da4 Clang/Windows: Clarify name of internal runtime library flags variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7606
2022-09-14 09:21:27 -04:00
Glen Chung
0e96a20478 MSVC: Add abstraction for debug information format
Replace our hard-coded default for `/Zi` with a first-class abstraction
to select the debug information format an enumeration of logical
names.  We've long hesitated to do this because the idea of "debug
information format" touches on related concepts on several platforms.
Avoid that scope creep by simply defining an abstraction that applies
only when targeting the MSVC ABI on Windows.

Removing the old default flag requires a policy because existing
projects may rely on string processing to edit them and choose a
runtime library under the old behavior.  Add policy CMP0141 to
provide compatibility.

Fixes: #10189
2022-09-14 09:12:47 -04:00
Brad King
06404a1979 Merge topic 'check-library-properties-fix-performances-regression'
985b4c82a6 Check link libraries properties: fix performances regression
a47eef32a3 renames method FinalizeTargetCompileInfo() in FinalizeTargetConfiguration().

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7651
2022-09-09 09:48:56 -04:00
Marc Chevrier
985b4c82a6 Check link libraries properties: fix performances regression
Fixes: #23939
2022-09-07 15:20:53 +02:00
Marc Chevrier
a47eef32a3 renames method FinalizeTargetCompileInfo() in FinalizeTargetConfiguration(). 2022-09-07 14:23:21 +02:00
Brad King
fc4451dd31 Merge topic 'xcode-add-gpu-validation-and-default-configuration'
740bee97bd Xcode: Add settings to control a scheme's launch configuration
39456c70e1 Xcode: Add settings to control a scheme's GPU Validation values
4034272ed8 gitignore: Tell Git to ignore the .cache/ directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7581
2022-08-31 09:43:50 -04:00
PatriceJiang
740bee97bd Xcode: Add settings to control a scheme's launch configuration 2022-08-30 10:28:27 -04:00
PatriceJiang
39456c70e1 Xcode: Add settings to control a scheme's GPU Validation values 2022-08-30 10:26:48 -04:00
Brad King
52c95540b7 target_*: Fix cross-directory call backtraces
Record the call-site backtrace, not the current backtrace of the
target's directory.

Fixes: #23873
2022-08-22 15:29:43 -04:00
Brad King
d9cca8e83d Merge topic 'verify-interface-header-sets-add-compile-definitions'
27fd172d8d VERIFY_INTERFACE_HEADER_SETS: Finalize compile info for verify targets
626e641a19 cmTarget: Factor out FinalizeTargetCompileInfo()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7516
2022-07-28 08:11:19 -04:00
Kyle Edwards
626e641a19 cmTarget: Factor out FinalizeTargetCompileInfo() 2022-07-27 12:24:53 -04:00
Brad King
5d8289116d Merge topic 'vs-compile-batching'
9a0a94fdaa VS: Add variable to to turn off Visual Studio compile batching
a7ebb73929 Help: Improve formatting in VS_NO_COMPILE_BATCHING docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7405
2022-06-23 09:23:56 -04:00
Brad King
9a0a94fdaa VS: Add variable to to turn off Visual Studio compile batching
Extend the change from commit b764c7c273 (VS: Add property to turn off
Visual Studio compile batching, 2022-02-07, v3.24.0-rc1~710^2) by
adding a variable to initialize the property on every target.

Issue: #23179
Fixes: #23639
2022-06-22 12:07:03 -04:00
Brad King
d94e09ec88 Merge topic 'cpp-named-module-file-sets'
07bc3b07ec gitlab-ci: test C++ modules using GCC
1b2270aa4e ci: add a Docker image to test out C++ modules with GCC
8c5a53096a Tests/RunCMake/CXXModules: add module-using examples
4151547e2f cmGlobalNinjaGenerator: use `cmModuleMapper` implementation
b43bdaff3c cmCxxModuleMapper: implement support for GCC's module map format
02d0f0e752 cmCxxModuleMapper: add source to handle module mapper contents
a046a45aad cmGlobalNinjaGenerator: add a TODO for header units
386465bf83 cmTarget: add support for C++ module fileset types
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7369
2022-06-17 11:35:12 -04:00
Ben Boeckel
386465bf83 cmTarget: add support for C++ module fileset types
C++ modules have two variants which are of importance to CMake:

  - `CXX_MODULES`: interface modules (those using `export module M;`,
    `export module M:part;`, or `module M:internal_part;`)
  - `CXX_MODULE_HEADER_UNITS`: importable header units

Creating C++ modules or partitions are *not* supported in any other
source listing. This is because the source files must be installed (so
their scope matters), but not part of usage requirements (what it means
for a module source to be injected into a consumer is not clear at this
moment). Due to the way `FILE_SET` works with scopes, they are a perfect
fit as long as `INTERFACE` is not allowed (which it is not).
2022-06-16 10:28:34 -04:00
Brad King
dd8befd9d3 Merge topic 'add_SYSTEM_prop'
69beee5314 Add SYSTEM target property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7308
2022-06-16 09:00:45 -04:00
Harry Mallon
a1a0ae3ad4 Xcode: Add Xcode SCHEME control for 'Launch' control 2022-06-15 19:02:56 +01:00
Da Quexian
69beee5314 Add SYSTEM target property
If it is ON, treat INTERFACE_INCLUDE_DIRECTORIES as system include directories.

Issue: #18040

Signed-off-by: Da Quexian <daquexian566@gmail.com>
2022-06-16 00:25:27 +08:00
Kyle Edwards
259c265112 VERIFY_HEADER_SETS: Rename to VERIFY_INTERFACE_HEADER_SETS
Issue: #23448
2022-05-18 10:18:40 -04:00
Brad King
79b64690d9 Merge topic 'werror-property'
76a08cd253 COMPILE_WARNING_AS_ERROR: Add options to treat warnings as errors

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Michael Hirsch <michael@scivision.dev>
Merge-request: !7187
2022-05-10 10:30:42 -04:00
Martin Duffy
76a08cd253 COMPILE_WARNING_AS_ERROR: Add options to treat warnings as errors
Add `COMPILE_WARNING_AS_ERROR` target property and supporting
`CMAKE_COMPILE_WARNING_AS_ERROR` variable.

`COMPILE_WARNING_AS_ERROR` is initialized by
`CMAKE_COMPILE_WARNING_AS_ERROR`. It is a boolean variable. If it is
true, it expands to a different flag depending on the compiler such that
any warnings at compile will be treated as errors.

Supports compiler ids that I could find a relevant flag for.
2022-05-06 12:14:37 -04:00
Cameron Cawley
33da5824ac OpenWatcom: Allow specifying the runtime library
Add a `CMAKE_WATCOM_RUNTIME_LIBRARY` variable to control the
runtime library selection.  Add policy CMP0136 to switch to
in place of the old hard-coded default flags.

Fixes: #23178
2022-05-06 10:40:58 -04:00
Ben Boeckel
aaa18f15cf cmTarget: add support for querying all file set names 2022-04-27 15:04:01 -04:00
Ben Boeckel
499009b79c cmTarget: avoid creating export entries if they don't exist 2022-04-27 14:30:41 -04:00
Ben Boeckel
9916d4dd44 cmTarget: factor out fileset type handling
This allows for new fileset types to be added more easily by factoring
out the declarative information into a structure.
2022-04-25 16:49:57 -04:00
Ben Boeckel
d74f9599f6 cmTarget: require filesets to be of the right type
With new types being proposed for C++ modules, requiring filesets to be
of the right type is now pertinent. No tests can be added yet as only
`HEADERS` is supported right now.
2022-04-25 14:29:17 -04:00
Ben Boeckel
5da4fe30a9 cmTarget: factor out fileset property manipulation 2022-04-25 14:29:17 -04:00
Ben Boeckel
c89580487b cmTarget: pass candidate strings by const-ref
This avoids having to copy the `std::string` overload.
2022-04-25 14:29:17 -04:00
Brad King
f011557f0e Merge topic 'xcode-universal'
40dd46a96a Xcode: Add tests for OBJECT library per target `OSX_ARCHITECTURES`
da4ccb502b Xcode: Check for multiple `OSX_ARCHITECTURES` on target
41ba35a42b cmTarget: Add `HasKnownObjectFileLocation()` shorthand

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7154
2022-04-14 09:30:29 -04:00
Brad King
f6476ba3a6 Merge topic 'file-set-repr-improvements'
5fa15ec9f3 Help: Document that target_sources defines [INTERFACE_]HEADER_SETS
c5d4812f20 cmTarget: make HEADER_SETS and INTERFACE_HEADER_SETS read-only
05783b168d cmFileSet: store visibility with the fileset

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7168
2022-04-12 10:05:26 -04:00
Hyper Nova Sun
41ba35a42b cmTarget: Add HasKnownObjectFileLocation() shorthand
Allow `cmGlobalGenerator`s to decide `HasKnownObjectFileLocation()` per given
`cmTarget`

- `cmGlobalGenerator::HasKnownObjectFileLocation()` now takes an optional `cmGeneratorTarget`
- `cmTarget::HasKnownObjectFileLocation()` added as a shorthand
2022-04-11 14:10:29 -07:00
Ben Boeckel
c5d4812f20 cmTarget: make HEADER_SETS and INTERFACE_HEADER_SETS read-only
There is no reason to allow these properties to be manipulated by user
code. Instead, use the stored visibility on the fileset objects to
derive what these properties should contain.
2022-04-11 14:06:15 -04:00
Ben Boeckel
05783b168d cmFileSet: store visibility with the fileset
The visibility is intrinsic to the fileset, so store it with it. This
avoids recalculating it on every addition to the fileset.
2022-04-11 13:41:40 -04:00
Kyle Edwards
c798744f81 FILE_SET: Add VERIFY_HEADER_SETS target property
Fixes: #23338
2022-03-29 13:58:27 -04:00
Brad King
687a91967f Revert INTERFACE_LINK_LIBRARIES_DIRECT feature for 3.23 branch
Revert commit f3ad061858 (Add usage requirements to update direct link
dependencies, 2022-01-12, v3.23.0-rc1~44^2) and the property storage
updates in its predecessor commit 193a999cd5 (cmTarget: Add
INTERFACE_LINK_LIBRARIES_DIRECT{,_EXCLUDE} backtrace storage,
2022-01-06, v3.23.0-rc1~44^2~1) from the 3.23 release branch.

After initial experience using the feature in practice, additional
design considerations have been raised for discussion in the original
issue.  To avoid rushing this for the 3.23 series, we've decided to
revert the feature for now so it can be revised for a future release.

Issue: #22496
2022-03-21 13:17:32 -04:00
Marc Chevrier
0a81ea1f12 Genex-LINK_GROUP: Add possibility to group libraries at link step
Fixes: #23121
2022-02-28 10:26:26 +01:00
Brad King
069d836dab Merge topic 'restore-target-export-includes'
83d79636bf install(TARGETS): Restore per-export INCLUDES DESTINATION

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6969
2022-02-10 09:07:35 -05:00
Brad King
5a65e08644 Merge topic 'restore-target-export-includes' into release-3.23
83d79636bf install(TARGETS): Restore per-export INCLUDES DESTINATION

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6969
2022-02-10 09:07:34 -05:00
Eugene Shalygin
83d79636bf install(TARGETS): Restore per-export INCLUDES DESTINATION
In commit 55e4753bbb (Refactor cmTargetExport removing
InterfaceIncludeDirecories, 2021-07-20, v3.22.0-rc1~337^2~1) the storage
of `INCLUDES DESTINATION` was moved into each target.  However, a target
may be installed in multiple exports, and their `INCLUDES DESTINATION`
should not be mixed.

Convert the IncludeDirectoriesEntries vector to a map and modify access
function to store the directories lists with respect to cmExportTarget
object. This fixes error when the same target is exported more than once
via different exports and each for consequent export its include
directories list grows. Add a test for this case.

Fixes: #23183
2022-02-09 13:31:26 -05: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
Brad King
193a999cd5 cmTarget: Add INTERFACE_LINK_LIBRARIES_DIRECT{,_EXCLUDE} backtrace storage
These properties will be given meaning by later commits.
2022-01-29 06:48:12 -05:00
Kyle Edwards
fce24e4f10 define_property(): Add INITIALIZE_FROM_VARIABLE argument
Fixes: #20698
2022-01-20 09:05:35 -05:00
Brad King
138aabfa9d Merge topic 'vs-csharp-dotnet-sdk'
0eea32a376 VS: Add DOTNET_SDK property to generate SDK-style C# projects
a450cc9533 VS: Set ResolveNugetPackages to false for ALL_BUILD and ZERO_CHECK
fa76e5d194 cmVisualStudio10TargetGenerator: Factor out helper for classic MSBuild project

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6634
2021-12-22 08:56:22 -05:00
Sumit Bhardwaj
0eea32a376 VS: Add DOTNET_SDK property to generate SDK-style C# projects
Changes in cmVisualStudio10TargetGenerator::Generate to write .Net
SDK-style project for VS generators VS 19 and above. Also adds
documentation and tests.

Issue: #20227
2021-12-21 09:35:49 -08:00
Brad King
37af6c3311 target_link_libraries: Optionally require only target names
Optionally verify that items in `LINK_LIBRARIES` and
`INTERFACE_LINK_LIBRARIES` that can be target names are actually target
names.  Add a `LINK_LIBRARIES_ONLY_TARGETS` target property and
corresponding `CMAKE_LINK_LIBRARIES_ONLY_TARGETS` variable to enable
this new check.

Fixes: #22858
2021-12-20 12:14:07 -05:00
Brad King
a84a62e0a7 cmTarget: Record backtraces for INTERFACE_LINK_LIBRARIES 2021-12-15 12:29:44 -05:00
Brad King
c749982c13 cmTargetPropertyComputer: Simplify by restoring use of cmMakefile
Logically revert commit 390a7d8647 (cmTargetPropertyComputer: Implement
GetProperty without cmMakefile, 2016-10-13, v3.8.0-rc1~445^2~9).
It relied on using `cmListFileBacktrace` to get a scope in which to
look up policies.

This does remove a backtrace from `LOCATION` property errors at generate
time, but the backtrace we reported before was incorrect.  It pointed at
the addition of a target, not to the reference to the property.
2021-12-08 10:03:48 -05:00
Brad King
7a149034f7 Merge topic 'xcode-generation-enablegpuframecapturemode'
0798edfb85 Tests: Xcode scheme ENABLE_GPU_FRAME_CAPTURE_MODE
e09a3eddb6 Xcode: Support "GPU Frame Capture" scheme property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6639
2021-11-12 09:05:01 -05:00